Added copy function (for ease in testing)