got rid of memset & memcpy