Added code for character repetitions