implement randomLoopSequence