reworked sort upgrade