Added recursive solution.