change to recursion solutions