Completed two solutions but actually one of the recoverTree