Almost there - need deduping for priorityqueue