added functions for checking repeats