making priority queue stable heap