Added reversing of string and check string for repetition