Change code to use copy().