Added version with recursion