add copy function
modified some files