modified:   checkRotations.m