change csd to memcpy