control, target changed to target[] in swap gates