replace list by a deque