reverses string and prints out steps