changes to loop and recursion