replaced memcpy by blkcpy