Replaced list with collections.deque for popping off the left side