procedure to minimize number of priorities needed