use dict replace deque