Adding priority queue implementation.