removing memcpy