Working on the iterative/recursive function