first version of priority queue