Implemented recursion.