Fixed Partition function

- I had understood split function wrongy...
- note to self always have unit tests for basic functions