simple implementation of PriorityQueue