deletion and resorting