add reverse reptend function