priority queue with classes