printReverse method implemented correctly