Recursion,edge cases