compact and reorder