version 1.0
modify for priorityqueue to use
with the help of were