Flanagan accepts position at Riverton