removing usage of memcpy code (again)