Added recursive solution