renamed generate_valid_sequences to valid_sequences