//main loop
main:
while (newOrbitStabilizer.orbitSize() != s) {
//this loop is redundant but helps to avoid unnecessary calculations of orbits in the main loop condition
int nextBasePoint = -1;
while ((nextBasePoint = allowedPoints.nextBit(++nextBasePoint)) != -1) {
//transversal
Permutation transversal = BSGS.get(i).getTransversalOf(nextBasePoint);
int newIndexUnderInverse = transversal.newIndexOfUnderInverse(jthBeta);
//check whether beta_{i+1}^(inverse transversal) belongs to orbit of G^{i+1}
if (!BSGS.get(i + 1).belongsToOrbit(newIndexUnderInverse)) {