improvements; priority queue