make repeat and random work