realloc memcopys the correct amount of data + fixed indentation