Implementing Priority queues