changed to priority queue, amended  key tracking