Added changes to incorporate memcpy