anson's recursive solution