Solved for reduced problem set.

Refactoring and further development required. Memoization will be
neccessary, good chance to explore a new monad.