Added copy() implementation and tests