See the tests ... what was before, stays before, what is inbetween comes next, then the sorted children and what was after last ...