modified copy method