Trying to get recursion code fully working