Have a look at my blog or using the great programming language, Haskell.