F# code in http://www.manning.com/petricek2/