added diagonal swapping upgrade