recursive sol