Created class PriorityQueue. Queue class modified to break on tail.