swapped iteration