added CopyToOutput macro