Solution for the Functional programming competitio, August 2014