Almost completed the build_copy function