change to priorityqueue