added recursive reverse method