Working split algorithm