don't rely on collections.deque.maxlen since it's not available in python 2.6