add a recursive solution