overlapped memcpy replaced with memmove