Almost done! Detecting repeats seems buggy, and q needs to be fixed.