a simple priority queue implementation