Algorithms coded in fsharp