hw on recursion and loops