Fix split function (now O=2n)