use non-quadratic tail recursive split here as well