changed to priorityqueue