Broken code for printing the last characters