cant use memcpy with a correct implementation of it, the data is overlapping. use memmove instead until a better fix