Solved 15 -- recursive solution needs optimizing