fixed bug if # repetitions is 1