add core code, write by fsharp