use memmove() because memory regions can overlap here