integrate copy funciton, ready to rename this :D