Changed buffer queue to deque
Changed buffer methods to deque