Stuck with Monads.
Initial simulated annealing attempt. Yet to find a solution.