code for a priority queue structure