Creating priority queue for scheduling