replace byte string with deque