got iterative and recursive methods working