fix repeats (is this the best way?)