Added copy functionality to the functions.