Implementing split, adding unit tests