Rewrite split to match haskell implementation
Outline implementation
More tinkering