priority queue simulation