Fixed bugs with priority queuing. Still need to do deque.