finishes recursion
completes recursion