working on raw pointer copy function