Modified deque to use memmove