recursion & memoization, plus Gosu