priority queue insert implementation