Haskell program for august2014 and a description of the algorithm.