Added priority queue stuff.