iterative and recursive reverse added