add memcpy and fix some styles