memcpy function added