trivial implementation of a priority queue with a heap