﻿function hello() {
  
  /*History
  This is Version number 1.2 of May 5, 2010
  1- All algorithm files have been updated with shorter (optimal) algs
  2- Midge sticker numbering has been changed to ease computing midge piece orientation directly from sticker numbers --> See new version of 'OrbitCube.pdf'
  3- New array 'var stickerLetters_Midges' added to reflect change in midge sticker numbering
  Previous Version number 1.1 of February 6, 2010*/
  
  /*General:
  Sticker Letters are strings (letters) ranging from "A" to "X". Letters "Y" and "Z" must *not* be used.*/
  
  /*DataBase Error Control: algorithms are looked up by index, where the index is computed from user selected letters, after conversion.
  In case of uncorrectly selected letters, void ("") algorithms are returned, indicating that letters should be changed.*/
  
  /*Corner Twists (3 variables):
  cornerTwist: integer number ranging from 0 to 1.
  If cornerTwist = 0, then corner1 is twisted clockwise (CW) and corner2 counterclockwise (CCW).
  If cornerTwist = 1, then corner1 is twisted counterclockwise (CCW) and corner2 clockwise (CW).
  stickerLetter1 and stickerLetter2 must be located on 2 distinct corner pieces.*/
  
  /* Corner Swaps (2 variables):
  stickerLetter1 and stickerLetter2 must be located on 2 distinct corner pieces.*/
  
  /* Midge Flips (2 variables) – Odd-order cubes only:
  stickerLetter1 and stickerLetter2 must be located on 2 distinct middle edge pieces.*/
  
  /* Edge Swaps (3 variables):
  orbit: integer number taking values in set (1, 2, 6, 9)
  stickerLetter1 and stickerLetter2 must be located on 2 distinct edge pieces.*/
  
  /*N-Cycles:
  orbit: integer number taking values in set (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12).
  Sticker Letters must be located on N distinct pieces (corners, edges, midges, centers).*/
  
  /*True Center Twists (6 variables) – Odd-order cubes only:
  trueCenterTwist_U, trueCenterTwist_Q, trueCenterTwist_M, trueCenterTwist_E, trueCenterTwist_I and trueCenterTwist_A are integer numbers ranging from 0 to 3, where 0 = 0°, 1 = 90°, 2 = 180° and 3 = 270° represent true center twists.
  The sum of the 6 center twists must be equal to 0 or 2 Modulo 4, ie. the sum of the 6 rotation angles must be equal to 0° or 180° Modulo 360°.*/
  
  //
  //Test settings (comment/uncomment):
  //
  //cycleStructures:
  //var cycleStructure = "TrueCenterTwists";
  //var cycleStructure = "CornerTwists";
  //var cycleStructure = "CornerSwaps";
  //var cycleStructure = "MidgeFlips";
  //var cycleStructure = "EdgeSwaps";
  
  var cycleStructure = "ThreeCycle";
  //var cycleStructure = "FiveCycle";
  //var cycleStructure = "SevenCycle";
  //var cycleStructure = "NineCycle";
  //var cycleStructure = "ElevenCycle";
  //var cycleStructure = "ThirteenCycle";
  //var cycleStructure = "FifteenCycle";
  //var cycleStructure = "SeventeenCycle";
  //var cycleStructure = "NineteenCycle";
  //var cycleStructure = "TwentyOneCycle";
  //var cycleStructure = "TwentyThreeCycle";
  
  //var cycleStructure = "TwoTwoCycles";
  //var cycleStructure = "FourTwoCycles";
  //var cycleStructure = "SixTwoCycles";
  //var cycleStructure = "EightTwoCycles";
  //var cycleStructure = "TenTwoCycles";
  //var cycleStructure = "TwelveTwoCycles";
  
  //var cycleStructure = "OneFourCyclePlusOneTwoCycle";
  //var cycleStructure = "OneFourCyclePlusThreeTwoCycles";
  //var cycleStructure = "OneFourCyclePlusFiveTwoCycles";
  //var cycleStructure = "OneFourCyclePlusSevenTwoCycles";
  //var cycleStructure = "OneFourCyclePlusNineTwoCycles";
  
  //var cycleStructure = "TwoFourCycles";
  //var cycleStructure = "TwoSixCycles";
  //var cycleStructure = "TwoEightCycles";
  //var cycleStructure = "TwoTenCycles";
  //var cycleStructure = "TwoTwelveCycles";
  
  //Variables Settings (Demo values --- Can be modified)
  //True Centers
  var trueCenterTwist_U = 0;
  var trueCenterTwist_Q = 1;
  var trueCenterTwist_M = 2;
  var trueCenterTwist_E = 3;
  var trueCenterTwist_I = 2;
  var trueCenterTwist_A = 2;
  
  //Corner Twist
  var cornerTwist = 0;
  
  //Orbit
  var orbit = 12;
  
  //Stickers (Supersede Demo values - not used for corners and midges):
  if (cycleStructure == "ThreeCycle") {
    var stickerLetter1 = "W";
    var stickerLetter2 = "E";
    var stickerLetter3 = "B";
    var cycle = "3-cycle";
    var permutation = "(W E B)";
  }
  else if (cycleStructure == "FiveCycle") {
    var stickerLetter1 = "R";
    var stickerLetter2 = "U";
    var stickerLetter3 = "B";
    var stickerLetter4 = "I";
    var stickerLetter5 = "K";
    var cycle = "5-cycle";
    var permutation = "(R U B I K)";
  }
  else if (cycleStructure == "SevenCycle") {
    var stickerLetter1 = "C";
    var stickerLetter2 = "H";
    var stickerLetter3 = "A";
    var stickerLetter4 = "R";
    var stickerLetter5 = "L";
    var stickerLetter6 = "I";
    var stickerLetter7 = "E";
    var cycle = "7-cycle";
    var permutation = "(C H A R L I E)";
  }
  else if (cycleStructure == "NineCycle") {
    var stickerLetter1 = "W";
    var stickerLetter2 = "O";
    var stickerLetter3 = "R";
    var stickerLetter4 = "D";
    var stickerLetter5 = "G";
    var stickerLetter6 = "A";
    var stickerLetter7 = "M";
    var stickerLetter8 = "E";
    var stickerLetter9 = "S";
    var cycle = "9-cycle";
    var permutation = "(W O R D G A M E S)";
  }
  else if (cycleStructure == "ElevenCycle") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "L";
    var stickerLetter3 = "G";
    var stickerLetter4 = "O";
    var stickerLetter5 = "R";
    var stickerLetter6 = "I";
    var stickerLetter7 = "T";
    var stickerLetter8 = "H";
    var stickerLetter9 = "M";
    var stickerLetter10 = "D";
    var stickerLetter11 = "B";
    var cycle = "11-cycle";
    var permutation = "(A L G O R I T H M D B)";
  }
  else if (cycleStructure == "ThirteenCycle") {
    var stickerLetter1 = "B";
    var stickerLetter2 = "U";
    var stickerLetter3 = "C";
    var stickerLetter4 = "K";
    var stickerLetter5 = "F";
    var stickerLetter6 = "A";
    var stickerLetter7 = "S";
    var stickerLetter8 = "T";
    var stickerLetter9 = "L";
    var stickerLetter10 = "E";
    var stickerLetter11 = "I";
    var stickerLetter12 = "G";
    var stickerLetter13 = "H";
    var cycle = "13-cycle";
    var permutation = "(B U C K F A S T L E I G H)";
  }
  else if (cycleStructure == "FifteenCycle") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var cycle = "15-cycle";
    var permutation = "(A E I M Q U B F J N R V C G K)";
  }
  else if (cycleStructure == "SeventeenCycle") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var cycle = "17-cycle";
    var permutation = "(A E I M Q U B F J N R V C G K O S)";
  }
  else if (cycleStructure == "NineteenCycle") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var cycle = "19-cycle";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D)";
  }
  else if (cycleStructure == "TwentyOneCycle") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var stickerLetter21 = "L";
    var cycle = "21-cycle";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H L)";
  }
  else if (cycleStructure == "TwentyThreeCycle") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var stickerLetter21 = "L";
    var stickerLetter22 = "P";
    var stickerLetter23 = "T";
    var cycle = "23-cycle";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H L P T)";
  }
  else if (cycleStructure == "TwoTwoCycles") {
    var stickerLetter1 = "G";
    var stickerLetter2 = "O";
    var stickerLetter3 = "L";
    var stickerLetter4 = "F";
    var cycle = "Two 2-cycles";
    var permutation = "(G O L F)";
  }
  else if (cycleStructure == "FourTwoCycles") {
    var stickerLetter1 = "E";
    var stickerLetter2 = "C";
    var stickerLetter3 = "H";
    var stickerLetter4 = "O";
    var stickerLetter5 = "L";
    var stickerLetter6 = "I";
    var stickerLetter7 = "M";
    var stickerLetter8 = "A";
    var cycle = "Four 2-cycles";
    var permutation = "(E C H O L I M A)";
  }
  else if (cycleStructure == "SixTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var cycle = "Six 2-cycles";
    var permutation = "(A E I M Q U B F J N R V)";
  }
  else if (cycleStructure == "EightTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var cycle = "Eight 2-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O)";
  }
  else if (cycleStructure == "TenTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var cycle = "Ten 2-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H)";
  }
  else if (cycleStructure == "TwelveTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var stickerLetter21 = "L";
    var stickerLetter22 = "P";
    var stickerLetter23 = "T";
    var stickerLetter24 = "X";
    var cycle = "Twelve 2-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H L P T X)";
  }
  else if (cycleStructure == "OneFourCyclePlusOneTwoCycle") {
    var stickerLetter1 = "R";
    var stickerLetter2 = "U";
    var stickerLetter3 = "B";
    var stickerLetter4 = "I";
    var stickerLetter5 = "K";
    var stickerLetter6 = "S";
    var cycle = "One 4-cycle + one 2-cycle";
    var permutation = "(R U B I K S)";
  }
  else if (cycleStructure == "OneFourCyclePlusThreeTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var cycle = "One 4-cycle + three 2-cycles";
    var permutation = "(A E I M Q U B F J N)";
  }
  else if (cycleStructure == "OneFourCyclePlusFiveTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var cycle = "One 4-cycle + five 2-cycles";
    var permutation = "(A E I M Q U B F J N R V C G)";
  }
  else if (cycleStructure == "OneFourCyclePlusSevenTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var cycle = "One 4-cycle + seven 2-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O S W)";
  }
  else if (cycleStructure == "OneFourCyclePlusNineTwoCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var stickerLetter21 = "L";
    var stickerLetter22 = "P";
    var cycle = "One 4-cycle + nine 2-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H L P)";
  }
  else if (cycleStructure == "TwoFourCycles") {
    var stickerLetter1 = "E";
    var stickerLetter2 = "C";
    var stickerLetter3 = "H";
    var stickerLetter4 = "O";
    var stickerLetter5 = "L";
    var stickerLetter6 = "I";
    var stickerLetter7 = "M";
    var stickerLetter8 = "A";
    var cycle = "Two 4-cycles";
    var permutation = "(E C H O L I M A)";
  }
  else if (cycleStructure == "TwoSixCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var cycle = "Two 6-cycles";
    var permutation = "(A E I M Q U B F J N R V)";
  }
  else if (cycleStructure == "TwoEightCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var cycle = "Two 8-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O)";
  }
  else if (cycleStructure == "TwoTenCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var cycle = "Two 10-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H)";
  }
  else if (cycleStructure == "TwoTwelveCycles") {
    var stickerLetter1 = "A";
    var stickerLetter2 = "E";
    var stickerLetter3 = "I";
    var stickerLetter4 = "M";
    var stickerLetter5 = "Q";
    var stickerLetter6 = "U";
    var stickerLetter7 = "B";
    var stickerLetter8 = "F";
    var stickerLetter9 = "J";
    var stickerLetter10 = "N";
    var stickerLetter11 = "R";
    var stickerLetter12 = "V";
    var stickerLetter13 = "C";
    var stickerLetter14 = "G";
    var stickerLetter15 = "K";
    var stickerLetter16 = "O";
    var stickerLetter17 = "S";
    var stickerLetter18 = "W";
    var stickerLetter19 = "D";
    var stickerLetter20 = "H";
    var stickerLetter21 = "L";
    var stickerLetter22 = "P";
    var stickerLetter23 = "T";
    var stickerLetter24 = "X";
    var cycle = "Two 12-cycles";
    var permutation = "(A E I M Q U B F J N R V C G K O S W D H L P T X)";
  }
  else {
    var stickerLetter1 = "I";
    var stickerLetter2 = "D";
    var cycle = cycleStructure;
    var permutation = "(I D)";
    var orbit = ": Undefined";
  }
  
  //Run Test:
  if (cycleStructure == "TrueCenterTwists") {
    var algorithm = getAlgorithm_TrueCenterTwists(trueCenterTwist_U, trueCenterTwist_Q, trueCenterTwist_M, trueCenterTwist_E, trueCenterTwist_I, trueCenterTwist_A) ;
  }
  else if (cycleStructure == "CornerTwists") {
    var algorithm = getAlgorithm_CornerTwists(cornerTwist, stickerLetter1, stickerLetter2) ;
  }
  else if (cycleStructure == "CornerSwaps") {
    var algorithm = getAlgorithm_CornerSwaps(stickerLetter1, stickerLetter2) ;
  }
  else if (cycleStructure == "MidgeFlips") {
    var algorithm = getAlgorithm_MidgeFlips(stickerLetter1, stickerLetter2) ;
  }
  else if (cycleStructure == "EdgeSwaps") {
    var algorithm = getAlgorithm_EdgeSwaps(orbit, stickerLetter1, stickerLetter2) ;
  }
  else if (cycleStructure == "ThreeCycle") {
    var algorithm = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  }
  else if (cycleStructure == "FiveCycle") {
    var algorithm = getAlgorithm_FiveCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5) ;
  }
  else if (cycleStructure == "SevenCycle") {
    var algorithm = getAlgorithm_SevenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7) ;
  }
  else if (cycleStructure == "NineCycle") {
    var algorithm = getAlgorithm_NineCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9) ;
  }
  else if (cycleStructure == "ElevenCycle") {
    var algorithm = getAlgorithm_ElevenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11) ;
  }
  else if (cycleStructure == "ThirteenCycle") {
    var algorithm = getAlgorithm_ThirteenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13) ;
  }
  else if (cycleStructure == "FifteenCycle") {
    var algorithm = getAlgorithm_FifteenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15) ;
  }
  else if (cycleStructure == "SeventeenCycle") {
    var algorithm = getAlgorithm_SeventeenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17) ;
  }
  else if (cycleStructure == "NineteenCycle") {
    var algorithm = getAlgorithm_NineteenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19) ;
  }
  else if (cycleStructure == "TwentyOneCycle") {
    var algorithm = getAlgorithm_TwentyOneCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21) ;
  }
  else if (cycleStructure == "TwentyThreeCycle") {
    var algorithm = getAlgorithm_TwentyThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22, stickerLetter23) ;
  }
  else if (cycleStructure == "TwoTwoCycles") {
    var algorithm = getAlgorithm_TwoTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4) ;
  }
  else if (cycleStructure == "FourTwoCycles") {
    var algorithm = getAlgorithm_FourTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8) ;
  }
  else if (cycleStructure == "SixTwoCycles") {
    var algorithm = getAlgorithm_SixTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12) ;
  }
  else if (cycleStructure == "EightTwoCycles") {
    var algorithm = getAlgorithm_EightTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16) ;
  }
  else if (cycleStructure == "TenTwoCycles") {
    var algorithm = getAlgorithm_TenTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20) ;
  }
  else if (cycleStructure == "TwelveTwoCycles") {
    var algorithm = getAlgorithm_TwelveTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22, stickerLetter23, stickerLetter24) ;
  }
  else if (cycleStructure == "OneFourCyclePlusOneTwoCycle") {
    var algorithm = getAlgorithm_OneFourCyclePlusOneTwoCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6) ;
  }
  else if (cycleStructure == "OneFourCyclePlusThreeTwoCycles") {
    var algorithm = getAlgorithm_OneFourCyclePlusThreeTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10) ;
  }
  else if (cycleStructure == "OneFourCyclePlusFiveTwoCycles") {
    var algorithm = getAlgorithm_OneFourCyclePlusFiveTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14) ;
  }
  else if (cycleStructure == "OneFourCyclePlusSevenTwoCycles") {
    var algorithm = getAlgorithm_OneFourCyclePlusSevenTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18) ;
  }
  else if (cycleStructure == "OneFourCyclePlusNineTwoCycles") {
    var algorithm = getAlgorithm_OneFourCyclePlusNineTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22) ;
  }
  else if (cycleStructure == "TwoFourCycles") {
    var algorithm = getAlgorithm_TwoFourCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8) ;
  }
  else if (cycleStructure == "TwoSixCycles") {
    var algorithm = getAlgorithm_TwoSixCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12) ;
  }
  else if (cycleStructure == "TwoEightCycles") {
    var algorithm = getAlgorithm_TwoEightCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16) ;
  }
  else if (cycleStructure == "TwoTenCycles") {
    var algorithm = getAlgorithm_TwoTenCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20) ;
  }
  else if (cycleStructure == "TwoTwelveCycles") {
    var algorithm = getAlgorithm_TwoTwelveCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22, stickerLetter23, stickerLetter24) ;
  }
  
  //Error Control: display result only if algorithm is not void.
  if (algorithm == "") {
    var msg = "Algorithm is void!";
    alert(msg);
  }
  else {
    var numberOfMoves = getNumberOfMoves(algorithm);
    document.writeln("AlgorithmPicker Demo" + "<br />" + "Orbit " + orbit + "<br />" + cycle + "<br />" + "Permutation: " + permutation + "<br />" + numberOfMoves + "-move algorithm:" + "<br />" + algorithm);
  }

}




function getAlgorithm_TrueCenterTwists(trueCenterTwist_U, trueCenterTwist_Q, trueCenterTwist_M, trueCenterTwist_E, trueCenterTwist_I, trueCenterTwist_A) {
  
  //Get algorithm from database of true center twists (odd-order cubes only)
  
  var trueCenterTwist_FaceB = trueCenterTwist_U ;
  var trueCenterTwist_FaceD = trueCenterTwist_Q ;
  var trueCenterTwist_FaceL = trueCenterTwist_M ;
  var trueCenterTwist_FaceU = trueCenterTwist_E ;
  var trueCenterTwist_FaceR = trueCenterTwist_I ;
  var trueCenterTwist_FaceF = trueCenterTwist_A ;
  
  var algorithmIndex = (trueCenterTwist_FaceB + 4 * trueCenterTwist_FaceD + 16 * trueCenterTwist_FaceL + 64 * trueCenterTwist_FaceU + 256 * trueCenterTwist_FaceR + 1024 * trueCenterTwist_FaceF) ;
  var algorithm = getAlgorithm_TrueCenters_Twists(algorithmIndex) ;
  
  return algorithm ;
}


function getAlgorithm_CornerTwists(cornerTwist, stickerLetter1, stickerLetter2) {
  
  //Get algorithm from database of corner twists (twist corner1 & Corner2 CW/CCW depending on value of cornerTwist)          
  
  //Initialize Orbit Cube conversion table
  var stickerLetters_Corners = new Array("D", "O", "F", "A", "E", "I", "B", "L", "S", "C", "R", "P", "W", "J", "H", "X", "G", "N", "U", "M", "Q", "V", "T", "K") ;
  
  //Convert Orbit Cube letters to numbers
  for (var iLoop = 0 ; iLoop < 24 ; iLoop++) {
    
    if (stickerLetter1 == stickerLetters_Corners[iLoop]) {
      var stickerNumber1 = iLoop ;
    }
    
    if (stickerLetter2 == stickerLetters_Corners[iLoop]) {
      var stickerNumber2 = iLoop ;
    }
    
  }
  //Note: variables j and k are corner numbers varying from 0 to 7 each
  var i = cornerTwist ;    
  var j = Math.floor(stickerNumber1/3) ;
  var k = Math.floor(stickerNumber2/3) ;
  
  var algorithmIndex = k + (j + i * 8) * 8 ;
  var algorithm = getAlgorithm_Corners_Twists(algorithmIndex) ;
  
  return algorithm ;
}


function getAlgorithm_CornerSwaps(stickerLetter1, stickerLetter2) {
  
  //Get algorithm from database of corner swaps (swap stickerLetter1 & stickerLetter2)          
  
  //Initialize Orbit Cube conversion table
  var stickerLetters_Corners = new Array("D", "O", "F", "A", "E", "I", "B", "L", "S", "C", "R", "P", "W", "J", "H", "X", "G", "N", "U", "M", "Q", "V", "T", "K") ;
  
  //Convert Orbit Cube letters to numbers
  for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
    
    if (stickerLetter1 == stickerLetters_Corners[iLoop]) {
      var stickerNumber1 = iLoop ;
    }
    
    if (stickerLetter2 == stickerLetters_Corners[iLoop]) {
      var stickerNumber2 = iLoop ;
    }
    
  }
  
  var i = stickerNumber1 ;
  var j = stickerNumber2 ;
  
  var algorithmIndex = j + i * 24
  var algorithm = getAlgorithm_Corners_Swaps(algorithmIndex) ;
  
  return algorithm ;
}


function getAlgorithm_MidgeFlips(stickerLetter1, stickerLetter2) {
   
   //Get algorithm from database of midge flips (flip stickerLetter1 & stickerLetter2)          
   
   //Initialize Orbit Cube conversion table
   var stickerLetters_Midges = new Array("I", "H", "S", "K", "P", "Q", "F", "N", "E", "D", "W", "G", "T", "U", "B", "R", "A", "L", "O", "C", "X", "M", "J", "V");
   
   //Convert Orbit Cube letters to numbers
   for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
     
     if (stickerLetter1 == stickerLetters_Midges[iLoop]) {
       var stickerNumber1 = iLoop ;
     }
     
     if (stickerLetter2 == stickerLetters_Midges[iLoop]) {
       var stickerNumber2 = iLoop ;
     }
     
  }
  
  i = stickerNumber1 ;
  j = stickerNumber2 ;
  
  var algorithmIndex = j + i * 24 ;
  var algorithm = getAlgorithm_Midges_Flips(algorithmIndex) ;
  
  return algorithm ;
}


function getAlgorithm_EdgeSwaps(orbit, stickerLetter1, stickerLetter2) {
  
  //Get algorithm from database of edge swaps (swap stickerLetter1 & stickerLetter2 in orbit)          
  
  //Initialize Orbit Cube conversion table
  var stickerLetters_Left = new Array("D", "A", "B", "C", "I", "J", "K", "L", "G", "H", "E", "F", "N", "O", "P", "M", "R", "S", "T", "Q", "W", "X", "U", "V");
  var stickerLetters_Right = new Array("A", "B", "C", "D", "J", "K", "L", "I", "H", "E", "F", "G", "O", "P", "M", "N", "S", "T", "Q", "R", "X", "U", "V", "W");
  var pairedStickerNumbers_Edges = new Array(10, 7, 16, 13, 9, 23, 17, 1, 20, 4, 0, 12, 11, 3, 19, 21, 2, 6, 22, 14, 8, 15, 18, 5);
  
  //Convert Orbit Cube letters to numbers – Left block – Default settings
  for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
    
    if (stickerLetter1 == stickerLetters_Left[iLoop])  {
      var stickerNumber1 = iLoop ;
    }
    
    if (stickerLetter2 == stickerLetters_Left[iLoop]) {
      var stickerNumber2 = iLoop ;
    }
    
  }
  
  var i = stickerNumber1 ;
  var j = stickerNumber2 ;
  
  //Convert Orbit Cube letters to numbers – Right block – Supersedes Default setting
  if ((orbit == 1) || (orbit == 2)) {    
    
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
    
      if (stickerLetter1 == stickerLetters_Right[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Right[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
    }
    
    //Right sticker numbers obtained from paired left sticker numbers
    var i = pairedStickerNumbers_Edges[stickerNumber1];
    var j = pairedStickerNumbers_Edges[stickerNumber2];
    
  }
  
  var algorithmIndex = j + i * 24 ;
  var algorithm = getAlgorithm_Edges_Swaps(algorithmIndex) ;
  
  //Algorithm scaling - Replace "N" with "N3"
  if ((orbit == 1) || (orbit == 9)) {
    var algorithm = algorithm.replace(/N/g, "N3") ;
  }
  
  return algorithm ;
}


function getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) {
  
  //Get algorithm from database of 3-cycles of stickers (i -> j -> k -> i)
  
  //Initialize Orbit Cube conversion tables
  var stickerLetters_Corners = new Array("D", "O", "F", "A", "E", "I", "B", "L", "S", "C", "R", "P", "W", "J", "H", "X", "G", "N", "U", "M", "Q", "V", "T", "K") ;
  var stickerLetters_Midges = new Array("I", "H", "S", "K", "P", "Q", "F", "N", "E", "D", "W", "G", "T", "U", "B", "R", "A", "L", "O", "C", "X", "M", "J", "V");
  var stickerLetters_Left = new Array("D", "A", "B", "C", "I", "J", "K", "L", "G", "H", "E", "F", "N", "O", "P", "M", "R", "S", "T", "Q", "W", "X", "U", "V") ;
  var stickerLetters_Right = new Array("A", "B", "C", "D", "J", "K", "L", "I", "H", "E", "F", "G", "O", "P", "M", "N", "S", "T", "Q", "R", "X", "U", "V", "W") ;
  var pairedStickerNumbers_Edges = new Array(10, 7, 16, 13, 9, 23, 17, 1, 20, 4, 0, 12, 11, 3, 19, 21, 2, 6, 22, 14, 8, 15, 18, 5) ;
  
  var algorithm = "";
  
  //Corners
  if (orbit == 3) {
    
    //Convert Orbit Cube letters to numbers (Corners)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
    
      if (stickerLetter1 == stickerLetters_Corners[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Corners[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Corners[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_Corners(algorithmIndex) ;
  }
  
  //Edges - Outer & Inner Wings - Right
  if ((orbit == 1) || (orbit == 2)) {
    
    //Convert Orbit Cube letters to numbers (Right block)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
      
      if (stickerLetter1 == stickerLetters_Right[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Right[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Right[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    //Right sticker numbers obtained from paired Left sticker numbers
    var i = pairedStickerNumbers_Edges[stickerNumber1] ;
    var j = pairedStickerNumbers_Edges[stickerNumber2] ;
    var k = pairedStickerNumbers_Edges[stickerNumber3] ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_Edges(algorithmIndex) ;
  }
  
  //Edges - Outer & Inner Wings - Left
  if ((orbit == 6) || (orbit == 9)) {
  
    //Convert Orbit Cube letters to numbers (Left block)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
      
      if (stickerLetter1 == stickerLetters_Left[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Left[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Left[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_Edges(algorithmIndex) ;
  }
  
  //Edges - Middle Edges (Midges)
  if (orbit == 12) {
    
    //Convert Orbit Cube letters to numbers (Midges)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
    
      if (stickerLetter1 == stickerLetters_Midges[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Midges[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Midges[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_Midges(algorithmIndex) ;
  }
  
  //Centers - Outer & Inner Corner-Centers
  if ((orbit == 5) || (orbit == 7)) {
    
    //Convert Orbit Cube letters to numbers (Left block)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++) {
      
      if (stickerLetter1 == stickerLetters_Left[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Left[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Left[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_CornerCenters(algorithmIndex) ;
  }
  
  //Centers - Outer Edge-Centers - Wing - Left
  if (orbit == 8) {
    
    //Convert Orbit Cube letters to numbers (Left block)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
      
      if (stickerLetter1 == stickerLetters_Left[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Left[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Left[iLoop]) {
        var stickerNumber3 = iLoop
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_EdgeCenters_Left(algorithmIndex) ;
  }
  
  //Centers - Outer Edge-Centers - Wing - Right
  if (orbit == 4) {
    
    //Convert Orbit Cube letters to numbers (Right block)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
    
      if (stickerLetter1 == stickerLetters_Right[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Right[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Right[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_EdgeCenters_Right(algorithmIndex) ;
  }
  
  //Centers - Outer & Inner Middle Centers
  if ((orbit == 10) || (orbit == 11)) {
    
    //Convert Orbit Cube letters to numbers (Left block)
    for (var iLoop = 0 ; iLoop < 24 ; iLoop++)    {
      
      if (stickerLetter1 == stickerLetters_Left[iLoop]) {
        var stickerNumber1 = iLoop ;
      }
      
      if (stickerLetter2 == stickerLetters_Left[iLoop]) {
        var stickerNumber2 = iLoop ;
      }
      
      if (stickerLetter3 == stickerLetters_Left[iLoop]) {
        var stickerNumber3 = iLoop ;
      }
      
    }
    
    var i = stickerNumber1 ;
    var j = stickerNumber2 ;
    var k = stickerNumber3 ;
    
    var algorithmIndex = k + (j + i * 24) * 24 ;
    algorithm = getAlgorithm_MidgeCenters(algorithmIndex) ;
  }
  
  //Algorithm scaling - Replace "N" with "N3"
  if ((orbit == 1) || (orbit == 7) || (orbit == 9) || (orbit == 10)) {
    algorithm = algorithm.replace(/N/g, "N3") ;
  }
  
  return algorithm;
}


function getAlgorithm_FiveCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5) {
  
  //5-cycle built from two 3-cycles – Optimized algorithm - 5 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5) = (1 2 3) (1 4 5)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 ;
  
  //(2 3 4 5 1) = (2 3 4) (2 5 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 ;
  
  //(3 4 5 1 2) = (3 4 5) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 ;
  
  //(4 5 1 2 3) = (4 5 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 ;
  
  //(5 1 2 3 4) = (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_SevenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7) {
  
  //7-cycle built from three 3-cycles – Optimized algorithm - 7 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7) = (1 2 3) (1 4 5) (1 6 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(2 3 4 5 6 7 1) = (2 3 4) (2 5 6) (2 7 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(3 4 5 6 7 1 2) = (3 4 5) (3 6 7) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(4 5 6 7 1 2 3) = (4 5 6) (4 7 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(5 6 7 1 2 3 4) = (5 6 7) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(6 7 1 2 3 4 5) = (6 7 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(7 1 2 3 4 5 6) = (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_NineCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9) {
  
  //9-cycle built from four 3-cycles – Optimized algorithm - 9 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7 8 9) = (1 2 3) (1 4 5) (1 6 7) (1 8 9)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 3 4 5 6 7 8 9 1) = (2 3 4) (2 5 6) (2 7 8) (2 9 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(3 4 5 6 7 8 9 1 2) = (3 4 5) (3 6 7) (3 8 9) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(4 5 6 7 8 9 1 2 3) = (4 5 6) (4 7 8) (4 9 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(5 6 7 8 9 1 2 3 4) = (5 6 7) (5 8 9) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(6 7 8 9 1 2 3 4 5) = (6 7 8) (6 9 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(7 8 9 1 2 3 4 5 6) = (7 8 9) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(8 9 1 2 3 4 5 6 7) = (8 9 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(9 1 2 3 4 5 6 7 8) = (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_ElevenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11) {
  
  //11-cycle built from five 3-cycles – Optimized algorithm - 11 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7 8 9 10 11) = (1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(2 3 4 5 6 7 8 9 10 11 1) = (2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(3 4 5 6 7 8 9 10 11 1 2) = (3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(4 5 6 7 8 9 10 11 1 2 3) = (4 5 6) (4 7 8) (4 9 10) (4 11 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(5 6 7 8 9 10 11 1 2 3 4) = (5 6 7) (5 8 9) (5 10 11) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(6 7 8 9 10 11 1 2 3 4 5) = (6 7 8) (6 9 10) (6 11 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(7 8 9 10 11 1 2 3 4 5 6) = (7 8 9) (7 10 11) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(8 9 10 11 1 2 3 4 5 6 7) = (8 9 10) (8 11 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(9 10 11 1 2 3 4 5 6 7 8) = (9 10 11) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(10 11 1 2 3 4 5 6 7 8 9) = (10 11 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(11 1 2 3 4 5 6 7 8 9 10) = (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_ThirteenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13) {
  
  //13-cycle built from six 3-cycles – Optimized algorithm - 13 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7 8 9 10 11 12 13) = (1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 13)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter13) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(2 3 4 5 6 7 8 9 10 11 12 13 1) = (2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 13 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(3 4 5 6 7 8 9 10 11 12 13 1 2) = (3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 13) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter13) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(4 5 6 7 8 9 10 11 12 13 1 2 3) = (4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 13 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(5 6 7 8 9 10 11 12 13 1 2 3 4) = (5 6 7) (5 8 9) (5 10 11) (5 12 13) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter13) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(6 7 8 9 10 11 12 13 1 2 3 4 5) = (6 7 8) (6 9 10) (6 11 12) (6 13 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(7 8 9 10 11 12 13 1 2 3 4 5 6) = (7 8 9) (7 10 11) (7 12 13) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter13) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(8 9 10 11 12 13 1 2 3 4 5 6 7) = (8 9 10) (8 11 12) (8 13 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(9 10 11 12 13 1 2 3 4 5 6 7 8) = (9 10 11) (9 12 13) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter13) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(10 11 12 13 1 2 3 4 5 6 7 8 9) = (10 11 12) (10 13 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(11 12 13 1 2 3 4 5 6 7 8 9 10) = (11 12 13) (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter13) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(12 13 1 2 3 4 5 6 7 8 9 10 11) = (12 13 1) (12 2 3) (12 4 5) (12 6 7) (12 8 9) (12 10 11)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //(13 1 2 3 4 5 6 7 8 9 10 11 12) = (13 1 2) (13 3 4) (13 5 6) (13 7 8) (13 9 10) (13 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_FifteenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15) {
  
  //15-cycle built from seven 3-cycles – Optimized algorithm - 15 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 13) (1 14 15)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter13) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter14, stickerLetter15) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 13 14) (2 15 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter15, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 13) (3 14 15) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter13) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter14, stickerLetter15) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 13 14) (4 15 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter14) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter15, stickerLetter1) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(5 6 7) (5 8 9) (5 10 11) (5 12 13) (5 14 15) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter13) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter14, stickerLetter15) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(6 7 8) (6 9 10) (6 11 12) (6 13 14) (6 15 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter14) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter15, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(7 8 9) (7 10 11) (7 12 13) (7 14 15) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter13) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter14, stickerLetter15) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(8 9 10) (8 11 12) (8 13 14) (8 15 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter14) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter15, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(9 10 11) (9 12 13) (9 14 15) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter13) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter14, stickerLetter15) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(10 11 12) (10 13 14) (10 15 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter14) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter15, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(11 12 13) (11 14 15) (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter13) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter14, stickerLetter15) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(12 13 14) (12 15 1) (12 2 3) (12 4 5) (12 6 7) (12 8 9) (12 10 11)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter14) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter15, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter8, stickerLetter9) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(13 14 15) (13 1 2) (13 3 4) (13 5 6) (13 7 8) (13 9 10) (13 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter15) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter9, stickerLetter10) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(14 15 1) (14 2 3) (14 4 5) (14 6 7) (14 8 9) (14 10 11) (14 12 13)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter15, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter10, stickerLetter11) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter12, stickerLetter13) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //(15 1 2) (15 3 4) (15 5 6) (15 7 8) (15 9 10) (15 11 12) (15 13 14)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_SeventeenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17) {
  
  //17-cycle built from eight 3-cycles – Optimized algorithm - 17 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 13) (1 14 15) (1 16 17)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter13) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter14, stickerLetter15) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter16, stickerLetter17) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 13 14) (2 15 16) (2 17 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter15, stickerLetter16) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter17, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 13) (3 14 15) (3 16 17) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter13) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter14, stickerLetter15) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter16, stickerLetter17) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 13 14) (4 15 16) (4 17 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter14) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter15, stickerLetter16) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter17, stickerLetter1) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(5 6 7) (5 8 9) (5 10 11) (5 12 13) (5 14 15) (5 16 17) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter13) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter14, stickerLetter15) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter16, stickerLetter17) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(6 7 8) (6 9 10) (6 11 12) (6 13 14) (6 15 16) (6 17 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter14) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter15, stickerLetter16) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter17, stickerLetter1) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(7 8 9) (7 10 11) (7 12 13) (7 14 15) (7 16 17) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter13) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter14, stickerLetter15) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter16, stickerLetter17) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(8 9 10) (8 11 12) (8 13 14) (8 15 16) (8 17 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter14) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter15, stickerLetter16) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter17, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(9 10 11) (9 12 13) (9 14 15) (9 16 17) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter13) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter14, stickerLetter15) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter16, stickerLetter17) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(10 11 12) (10 13 14) (10 15 16) (10 17 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter14) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter15, stickerLetter16) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter17, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(11 12 13) (11 14 15) (11 16 17) (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter13) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter14, stickerLetter15) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter16, stickerLetter17) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(12 13 14) (12 15 16) (12 17 1) (12 2 3) (12 4 5) (12 6 7) (12 8 9) (12 10 11)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter14) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter15, stickerLetter16) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter17, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter6, stickerLetter7) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter8, stickerLetter9) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(13 14 15) (13 16 17) (13 1 2) (13 3 4) (13 5 6) (13 7 8) (13 9 10) (13 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter15) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter16, stickerLetter17) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter7, stickerLetter8) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter9, stickerLetter10) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(14 15 16) (14 17 1) (14 2 3) (14 4 5) (14 6 7) (14 8 9) (14 10 11) (14 12 13)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter15, stickerLetter16) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter17, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter8, stickerLetter9) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter10, stickerLetter11) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter12, stickerLetter13) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(15 16 17) (15 1 2) (15 3 4) (15 5 6) (15 7 8) (15 9 10) (15 11 12) (15 13 14)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter17) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter9, stickerLetter10) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter11, stickerLetter12) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(16 17 1) (16 2 3) (16 4 5) (16 6 7) (16 8 9) (16 10 11) (16 12 13) (16 14 15)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter17, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter10, stickerLetter11) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter12, stickerLetter13) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter14, stickerLetter15) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[15] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(17 1 2) (17 3 4) (17 5 6) (17 7 8) (17 9 10) (17 11 12) (17 13 14) (17 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[16] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_NineteenCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19) {
  
  //19-cycle built from nine 3-cycles – Optimized algorithm - 19 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 13) (1 14 15) (1 16 17) (1 18 19)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter13) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter14, stickerLetter15) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter16, stickerLetter17) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter18, stickerLetter19) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 13 14) (2 15 16) (2 17 18) (2 19 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter15, stickerLetter16) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter17, stickerLetter18) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter19, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 13) (3 14 15) (3 16 17) (3 18 19) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter13) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter14, stickerLetter15) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter16, stickerLetter17) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter18, stickerLetter19) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 13 14) (4 15 16) (4 17 18) (4 19 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter14) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter15, stickerLetter16) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter17, stickerLetter18) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter19, stickerLetter1) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(5 6 7) (5 8 9) (5 10 11) (5 12 13) (5 14 15) (5 16 17) (5 18 19) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter13) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter14, stickerLetter15) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter16, stickerLetter17) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter18, stickerLetter19) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(6 7 8) (6 9 10) (6 11 12) (6 13 14) (6 15 16) (6 17 18) (6 19 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter14) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter15, stickerLetter16) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter17, stickerLetter18) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter19, stickerLetter1) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(7 8 9) (7 10 11) (7 12 13) (7 14 15) (7 16 17) (7 18 19) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter13) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter14, stickerLetter15) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter16, stickerLetter17) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter18, stickerLetter19) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(8 9 10) (8 11 12) (8 13 14) (8 15 16) (8 17 18) (8 19 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter14) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter15, stickerLetter16) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter17, stickerLetter18) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter19, stickerLetter1) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(9 10 11) (9 12 13) (9 14 15) (9 16 17) (9 18 19) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter13) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter14, stickerLetter15) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter16, stickerLetter17) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter18, stickerLetter19) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(10 11 12) (10 13 14) (10 15 16) (10 17 18) (10 19 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter14) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter15, stickerLetter16) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter17, stickerLetter18) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter19, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(11 12 13) (11 14 15) (11 16 17) (11 18 19) (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter13) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter14, stickerLetter15) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter16, stickerLetter17) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter18, stickerLetter19) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(12 13 14) (12 15 16) (12 17 18) (12 19 1) (12 2 3) (12 4 5) (12 6 7) (12 8 9) (12 10 11)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter14) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter15, stickerLetter16) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter17, stickerLetter18) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter19, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter4, stickerLetter5) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter6, stickerLetter7) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter8, stickerLetter9) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(13 14 15) (13 16 17) (13 18 19) (13 1 2) (13 3 4) (13 5 6) (13 7 8) (13 9 10) (13 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter15) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter16, stickerLetter17) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter18, stickerLetter19) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter5, stickerLetter6) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter7, stickerLetter8) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter9, stickerLetter10) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(14 15 16) (14 17 18) (14 19 1) (14 2 3) (14 4 5) (14 6 7) (14 8 9) (14 10 11) (14 12 13)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter15, stickerLetter16) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter17, stickerLetter18) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter19, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter6, stickerLetter7) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter8, stickerLetter9) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter10, stickerLetter11) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter12, stickerLetter13) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(15 16 17) (15 18 19) (15 1 2) (15 3 4) (15 5 6) (15 7 8) (15 9 10) (15 11 12) (15 13 14)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter17) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter18, stickerLetter19) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter7, stickerLetter8) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter9, stickerLetter10) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter11, stickerLetter12) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(16 17 18) (16 19 1) (16 2 3) (16 4 5) (16 6 7) (16 8 9) (16 10 11) (16 12 13) (16 14 15)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter17, stickerLetter18) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter19, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter8, stickerLetter9) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter10, stickerLetter11) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter12, stickerLetter13) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter14, stickerLetter15) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[15] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(17 18 19) (17 1 2) (17 3 4) (17 5 6) (17 7 8) (17 9 10) (17 11 12) (17 13 14) (17 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter19) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter9, stickerLetter10) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter11, stickerLetter12) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter13, stickerLetter14) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[16] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(18 19 1) (18 2 3) (18 4 5) (18 6 7) (18 8 9) (18 10 11) (18 12 13) (18 14 15) (18 16 17)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter19, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter10, stickerLetter11) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter12, stickerLetter13) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter14, stickerLetter15) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter16, stickerLetter17) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[17] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //(19 1 2) (19 3 4) (19 5 6) (19 7 8) (19 9 10) (19 11 12) (19 13 14) (19 15 16) (19 17 18)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter17, stickerLetter18) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[18] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwentyOneCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21) {
  
  //21-cycle built from ten 3-cycles – Optimized algorithm - 21 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 13) (1 14 15) (1 16 17) (1 18 19) (1 20 21)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter13) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter14, stickerLetter15) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter16, stickerLetter17) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter18, stickerLetter19) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter20, stickerLetter21) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 13 14) (2 15 16) (2 17 18) (2 19 20) (2 21 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter15, stickerLetter16) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter17, stickerLetter18) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter19, stickerLetter20) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter21, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 13) (3 14 15) (3 16 17) (3 18 19) (3 20 21) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter13) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter14, stickerLetter15) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter16, stickerLetter17) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter18, stickerLetter19) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter20, stickerLetter21) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 13 14) (4 15 16) (4 17 18) (4 19 20) (4 21 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter14) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter15, stickerLetter16) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter17, stickerLetter18) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter19, stickerLetter20) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter21, stickerLetter1) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(5 6 7) (5 8 9) (5 10 11) (5 12 13) (5 14 15) (5 16 17) (5 18 19) (5 20 21) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter13) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter14, stickerLetter15) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter16, stickerLetter17) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter18, stickerLetter19) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter20, stickerLetter21) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(6 7 8) (6 9 10) (6 11 12) (6 13 14) (6 15 16) (6 17 18) (6 19 20) (6 21 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter14) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter15, stickerLetter16) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter17, stickerLetter18) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter19, stickerLetter20) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter21, stickerLetter1) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(7 8 9) (7 10 11) (7 12 13) (7 14 15) (7 16 17) (7 18 19) (7 20 21) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter13) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter14, stickerLetter15) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter16, stickerLetter17) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter18, stickerLetter19) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter20, stickerLetter21) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(8 9 10) (8 11 12) (8 13 14) (8 15 16) (8 17 18) (8 19 20) (8 21 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter14) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter15, stickerLetter16) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter17, stickerLetter18) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter19, stickerLetter20) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter21, stickerLetter1) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(9 10 11) (9 12 13) (9 14 15) (9 16 17) (9 18 19) (9 20 21) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter13) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter14, stickerLetter15) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter16, stickerLetter17) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter18, stickerLetter19) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter20, stickerLetter21) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(10 11 12) (10 13 14) (10 15 16) (10 17 18) (10 19 20) (10 21 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter14) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter15, stickerLetter16) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter17, stickerLetter18) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter19, stickerLetter20) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter21, stickerLetter1) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(11 12 13) (11 14 15) (11 16 17) (11 18 19) (11 20 21) (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter13) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter14, stickerLetter15) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter16, stickerLetter17) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter18, stickerLetter19) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter20, stickerLetter21) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(12 13 14) (12 15 16) (12 17 18) (12 19 20) (12 21 1) (12 2 3) (12 4 5) (12 6 7) (12 8 9) (12 10 11)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter14) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter15, stickerLetter16) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter17, stickerLetter18) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter19, stickerLetter20) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter21, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter2, stickerLetter3) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter4, stickerLetter5) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter6, stickerLetter7) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter8, stickerLetter9) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(13 14 15) (13 16 17) (13 18 19) (13 20 21) (13 1 2) (13 3 4) (13 5 6) (13 7 8) (13 9 10) (13 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter15) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter16, stickerLetter17) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter18, stickerLetter19) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter20, stickerLetter21) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter3, stickerLetter4) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter5, stickerLetter6) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter7, stickerLetter8) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter9, stickerLetter10) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(14 15 16) (14 17 18) (14 19 20) (14 21 1) (14 2 3) (14 4 5) (14 6 7) (14 8 9) (14 10 11) (14 12 13)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter15, stickerLetter16) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter17, stickerLetter18) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter19, stickerLetter20) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter21, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter4, stickerLetter5) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter6, stickerLetter7) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter8, stickerLetter9) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter10, stickerLetter11) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter12, stickerLetter13) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(15 16 17) (15 18 19) (15 20 21) (15 1 2) (15 3 4) (15 5 6) (15 7 8) (15 9 10) (15 11 12) (15 13 14)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter17) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter18, stickerLetter19) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter20, stickerLetter21) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter5, stickerLetter6) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter7, stickerLetter8) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter9, stickerLetter10) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter11, stickerLetter12) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(16 17 18) (16 19 20) (16 21 1) (16 2 3) (16 4 5) (16 6 7) (16 8 9) (16 10 11) (16 12 13) (16 14 15)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter17, stickerLetter18) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter19, stickerLetter20) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter21, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter6, stickerLetter7) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter8, stickerLetter9) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter10, stickerLetter11) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter12, stickerLetter13) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter14, stickerLetter15) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[15] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(17 18 19) (17 20 21) (17 1 2) (17 3 4) (17 5 6) (17 7 8) (17 9 10) (17 11 12) (17 13 14) (17 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter19) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter20, stickerLetter21) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter7, stickerLetter8) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter9, stickerLetter10) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter11, stickerLetter12) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter13, stickerLetter14) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[16] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(18 19 20) (18 21 1) (18 2 3) (18 4 5) (18 6 7) (18 8 9) (18 10 11) (18 12 13) (18 14 15) (18 16 17)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter19, stickerLetter20) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter21, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter8, stickerLetter9) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter10, stickerLetter11) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter12, stickerLetter13) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter14, stickerLetter15) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter16, stickerLetter17) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[17] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(19 20 21) (19 1 2) (19 3 4) (19 5 6) (19 7 8) (19 9 10) (19 11 12) (19 13 14) (19 15 16) (19 17 18)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter20, stickerLetter21) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter9, stickerLetter10) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter11, stickerLetter12) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter13, stickerLetter14) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter15, stickerLetter16) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter17, stickerLetter18) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[18] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(20 21 1) (20 2 3) (20 4 5) (20 6 7) (20 8 9) (20 10 11) (20 12 13) (20 14 15) (20 16 17) (20 18 19)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter21, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter10, stickerLetter11) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter12, stickerLetter13) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter14, stickerLetter15) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter16, stickerLetter17) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter18, stickerLetter19) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[19] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(21 1 2) (21 3 4) (21 5 6) (21 7 8) (21 9 10) (21 11 12) (21 13 14) (21 15 16) (21 17 18) (21 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[20] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwentyThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22, stickerLetter23) {
  
  //23-cycle built from eleven 3-cycles – Optimized algorithm - 23 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 13) (1 14 15) (1 16 17) (1 18 19) (1 20 21) (1 22 23)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter13) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter14, stickerLetter15) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter16, stickerLetter17) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter18, stickerLetter19) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter20, stickerLetter21) ;
  var algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter22, stickerLetter23) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 13 14) (2 15 16) (2 17 18) (2 19 20) (2 21 22) (2 23 1)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter15, stickerLetter16) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter17, stickerLetter18) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter19, stickerLetter20) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter21, stickerLetter22) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter23, stickerLetter1) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 13) (3 14 15) (3 16 17) (3 18 19) (3 20 21) (3 22 23) (3 1 2)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter13) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter14, stickerLetter15) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter16, stickerLetter17) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter18, stickerLetter19) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter20, stickerLetter21) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter22, stickerLetter23) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter1, stickerLetter2) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 13 14) (4 15 16) (4 17 18) (4 19 20) (4 21 22) (4 23 1) (4 2 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter14) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter15, stickerLetter16) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter17, stickerLetter18) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter19, stickerLetter20) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter21, stickerLetter22) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter23, stickerLetter1) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter2, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(5 6 7) (5 8 9) (5 10 11) (5 12 13) (5 14 15) (5 16 17) (5 18 19) (5 20 21) (5 22 23) (5 1 2) (5 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter13) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter14, stickerLetter15) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter16, stickerLetter17) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter18, stickerLetter19) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter20, stickerLetter21) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter22, stickerLetter23) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter1, stickerLetter2) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(6 7 8) (6 9 10) (6 11 12) (6 13 14) (6 15 16) (6 17 18) (6 19 20) (6 21 22) (6 23 1) (6 2 3) (6 4 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter14) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter15, stickerLetter16) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter17, stickerLetter18) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter19, stickerLetter20) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter21, stickerLetter22) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter23, stickerLetter1) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter2, stickerLetter3) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter4, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(7 8 9) (7 10 11) (7 12 13) (7 14 15) (7 16 17) (7 18 19) (7 20 21) (7 22 23) (7 1 2) (7 3 4) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter13) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter14, stickerLetter15) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter16, stickerLetter17) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter18, stickerLetter19) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter20, stickerLetter21) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter22, stickerLetter23) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter1, stickerLetter2) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter3, stickerLetter4) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(8 9 10) (8 11 12) (8 13 14) (8 15 16) (8 17 18) (8 19 20) (8 21 22) (8 23 1) (8 2 3) (8 4 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter14) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter15, stickerLetter16) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter17, stickerLetter18) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter19, stickerLetter20) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter21, stickerLetter22) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter23, stickerLetter1) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter2, stickerLetter3) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter4, stickerLetter5) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(9 10 11) (9 12 13) (9 14 15) (9 16 17) (9 18 19) (9 20 21) (9 22 23) (9 1 2) (9 3 4) (9 5 6) (9 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter13) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter14, stickerLetter15) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter16, stickerLetter17) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter18, stickerLetter19) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter20, stickerLetter21) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter22, stickerLetter23) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter1, stickerLetter2) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter3, stickerLetter4) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter5, stickerLetter6) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(10 11 12) (10 13 14) (10 15 16) (10 17 18) (10 19 20) (10 21 22) (10 23 1) (10 2 3) (10 4 5) (10 6 7) (10 8 9)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter14) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter15, stickerLetter16) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter17, stickerLetter18) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter19, stickerLetter20) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter21, stickerLetter22) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter23, stickerLetter1) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter2, stickerLetter3) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter4, stickerLetter5) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter6, stickerLetter7) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter8, stickerLetter9) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(11 12 13) (11 14 15) (11 16 17) (11 18 19) (11 20 21) (11 22 23) (11 1 2) (11 3 4) (11 5 6) (11 7 8) (11 9 10)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter13) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter14, stickerLetter15) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter16, stickerLetter17) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter18, stickerLetter19) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter20, stickerLetter21) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter22, stickerLetter23) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter1, stickerLetter2) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter3, stickerLetter4) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter5, stickerLetter6) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter7, stickerLetter8) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(12 13 14) (12 15 16) (12 17 18) (12 19 20) (12 21 22) (12 23 1) (12 2 3) (12 4 5) (12 6 7) (12 8 9) (12 10 11)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter14) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter15, stickerLetter16) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter17, stickerLetter18) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter19, stickerLetter20) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter21, stickerLetter22) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter23, stickerLetter1) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter2, stickerLetter3) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter4, stickerLetter5) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter6, stickerLetter7) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter8, stickerLetter9) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter10, stickerLetter11) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(13 14 15) (13 16 17) (13 18 19) (13 20 21) (13 22 23) (13 1 2) (13 3 4) (13 5 6) (13 7 8) (13 9 10) (13 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter15) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter16, stickerLetter17) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter18, stickerLetter19) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter20, stickerLetter21) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter22, stickerLetter23) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter1, stickerLetter2) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter3, stickerLetter4) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter5, stickerLetter6) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter7, stickerLetter8) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter9, stickerLetter10) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(14 15 16) (14 17 18) (14 19 20) (14 21 22) (14 23 1) (14 2 3) (14 4 5) (14 6 7) (14 8 9) (14 10 11) (14 12 13)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter15, stickerLetter16) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter17, stickerLetter18) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter19, stickerLetter20) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter21, stickerLetter22) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter23, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter2, stickerLetter3) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter4, stickerLetter5) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter6, stickerLetter7) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter8, stickerLetter9) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter10, stickerLetter11) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter14, stickerLetter12, stickerLetter13) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(15 16 17) (15 18 19) (15 20 21) (15 22 23) (15 1 2) (15 3 4) (15 5 6) (15 7 8) (15 9 10) (15 11 12) (15 13 14)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter17) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter18, stickerLetter19) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter20, stickerLetter21) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter22, stickerLetter23) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter3, stickerLetter4) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter5, stickerLetter6) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter7, stickerLetter8) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter9, stickerLetter10) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter11, stickerLetter12) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(16 17 18) (16 19 20) (16 21 22) (16 23 1) (16 2 3) (16 4 5) (16 6 7) (16 8 9) (16 10 11) (16 12 13) (16 14 15)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter17, stickerLetter18) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter19, stickerLetter20) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter21, stickerLetter22) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter23, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter4, stickerLetter5) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter6, stickerLetter7) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter8, stickerLetter9) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter10, stickerLetter11) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter12, stickerLetter13) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter16, stickerLetter14, stickerLetter15) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[15] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(17 18 19) (17 20 21) (17 22 23) (17 1 2) (17 3 4) (17 5 6) (17 7 8) (17 9 10) (17 11 12) (17 13 14) (17 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter19) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter20, stickerLetter21) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter22, stickerLetter23) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter5, stickerLetter6) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter7, stickerLetter8) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter9, stickerLetter10) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter11, stickerLetter12) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter13, stickerLetter14) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[16] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(18 19 20) (18 21 22) (18 23 1) (18 2 3) (18 4 5) (18 6 7) (18 8 9) (18 10 11) (18 12 13) (18 14 15) (18 16 17)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter19, stickerLetter20) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter21, stickerLetter22) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter23, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter6, stickerLetter7) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter8, stickerLetter9) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter10, stickerLetter11) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter12, stickerLetter13) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter14, stickerLetter15) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter18, stickerLetter16, stickerLetter17) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[17] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(19 20 21) (19 22 23) (19 1 2) (19 3 4) (19 5 6) (19 7 8) (19 9 10) (19 11 12) (19 13 14) (19 15 16) (19 17 18)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter20, stickerLetter21) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter22, stickerLetter23) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter7, stickerLetter8) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter9, stickerLetter10) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter11, stickerLetter12) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter13, stickerLetter14) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter15, stickerLetter16) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter17, stickerLetter18) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[18] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(20 21 22) (20 23 1) (20 2 3) (20 4 5) (20 6 7) (20 8 9) (20 10 11) (20 12 13) (20 14 15) (20 16 17) (20 18 19)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter21, stickerLetter22) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter23, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter8, stickerLetter9) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter10, stickerLetter11) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter12, stickerLetter13) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter14, stickerLetter15) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter16, stickerLetter17) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter20, stickerLetter18, stickerLetter19) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[19] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(21 22 23) (21 1 2) (21 3 4) (21 5 6) (21 7 8) (21 9 10) (21 11 12) (21 13 14) (21 15 16) (21 17 18) (21 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter22, stickerLetter23) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter9, stickerLetter10) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter11, stickerLetter12) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter13, stickerLetter14) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter15, stickerLetter16) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter17, stickerLetter18) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[20] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(22 23 1) (22 2 3) (22 4 5) (22 6 7) (22 8 9) (22 10 11) (22 12 13) (22 14 15) (22 16 17) (22 18 19) (22 20 21)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter23, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter10, stickerLetter11) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter12, stickerLetter13) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter14, stickerLetter15) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter16, stickerLetter17) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter18, stickerLetter19) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter22, stickerLetter20, stickerLetter21) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[21] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //(23 1 2) (23 3 4) (23 5 6) (23 7 8) (23 9 10) (23 11 12) (23 13 14) (23 15 16) (23 17 18) (23 19 20) (23 21 22)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter23, stickerLetter21, stickerLetter22) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[22] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwoTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4) {
  
  //2 2-cycles built from two 3-cycles – Optimized algorithm - 4 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2) (3 4) = (1 2 4) (1 3 4)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 ;
  
  //(1 2) (4 3) = (1 2 3) (1 4 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 ;
  
  //(2 1) (3 4) = (2 1 4) (2 3 4)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 ;
  
  //(2 1) (4 3) = (2 1 3) (2 4 3)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter3) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter4, stickerLetter3) ;
  if ((algorithm1 == "") || (algorithm2 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_FourTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8) {
  
  //4 2-cycles built from four 3-cycles – Optimized algorithm - 16 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 4) (1 3 4) • (5 6 8) (5 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 3) (1 4 3) • (5 6 8) (5 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 4) (2 3 4) • (5 6 8) (5 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 3) (2 4 3) • (5 6 8) (5 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 4) (1 3 4) • (5 6 7) (5 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 4) (1 3 4) • (5 6 7) (5 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 4) (2 3 4) • (5 6 7) (5 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 3) (2 4 3) • (5 6 7) (5 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 4) (1 3 4) • (6 5 8) (6 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 3) (1 4 3) • (6 5 8) (6 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 4) (2 3 4) • (6 5 8) (6 7 8))
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 3) (2 4 3) • (6 5 8) (6 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 4) (1 3 4) • (6 5 7) (6 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 3) (1 4 3) • (6 5 7) (6 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 4) (2 3 4) • (6 5 7) (6 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 1 3) (2 4 3) • (6 5 7) (6 8 7)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[15] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_SixTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12) {
  
  //6 2-cycles built from six 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 4) (1 3 4) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6  ;
  
  //(1 2 3) (1 4 3) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6  ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_EightTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16) {
  
  //8 2-cycles built from eight 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 4) (1 3 4) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12) • (13 14 16) (13 15 16)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter16) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8  ;
  
  //(1 2 3) (1 4 3) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12) • (13 14 16) (13 15 16)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter16) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8  ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TenTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20) {
  
  //10 2-cycles built from ten 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 4) (1 3 4) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12) • (13 14 16) (13 15 16) • (17 18 20) (17 19 20)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter16) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter20) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10   ;
  
  //(1 2 3) (1 4 3) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12) • (13 14 16) (13 15 16) • (17 18 20) (17 19 20)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter16) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter20) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10   ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwelveTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22, stickerLetter23, stickerLetter24) {
  
  //12 2-cycles built from twelve 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 4) (1 3 4) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12) • (13 14 16) (13 15 16) • (17 18 20) (17 19 20) • (21 22 24) (21 23 24)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter3, stickerLetter4) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter16) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter20) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter19, stickerLetter20) ;
  var algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter22, stickerLetter24) ;
  var algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12   ;
  
  //(1 2 3) (1 4 3) • (5 6 8) (5 7 8) • (9 10 12) (9 11 12) • (13 14 16) (13 15 16) • (17 18 20) (17 19 20) • (21 22 24) (21 23 24)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter3) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter14, stickerLetter16) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter18, stickerLetter20) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter17, stickerLetter19, stickerLetter20) ;
  var algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter22, stickerLetter24) ;
  var algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter21, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12   ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_OneFourCyclePlusOneTwoCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6) {
  
  //1 4-cycle + 1 2-cycle built from three 3-cycles - Optimized Algorithm - 8 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) • (1 4 6) • (1 5 6)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(1 2 3) • (1 4 5) • (1 6 5)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(2 3 4) • (2 1 6) • (2 5 6)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(2 3 4) • (2 1 5) • (2 6 5)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter6, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(3 4 1) • (3 2 6) • (3 5 6)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter1) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(3 4 1) • (3 2 5) • (3 6 5)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter1) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(4 1 2) • (4 3 5) • (4 5 6)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //(4 1 2) • (4 3 5) • (4 6 5)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter6, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_OneFourCyclePlusThreeTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10) {
  
  //1 4-cycle + 3 2-cycles built from five 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) • (1 4 6) • (1 5 6) • (7 8 10) (7 9 10)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter5, stickerLetter6) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //(2 3 4) • (2 1 6) • (2 5 6) • (7 8 10) (7 9 10)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_OneFourCyclePlusFiveTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14) {
  
  //1 4-cycle + 5 2-cycles built from seven 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) • (1 4 6) • (1 5 6) • (7 8 10) (7 9 10) • (11 12 14) (11 13 14)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter5, stickerLetter6) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 ;
  
  //(1 2 3) • (1 4 5) • (1 6 5) • (7 8 10) (7 9 10) • (11 12 14) (11 13 14)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter5) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_OneFourCyclePlusSevenTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18) {
  
  //1 4-cycle + 7 2-cycles built from nine 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) • (1 4 6) • (1 5 6) • (7 8 10) (7 9 10) • (11 12 14) (11 13 14) • (15 16 18) (15 17 18)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter5, stickerLetter6) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter18) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter17, stickerLetter18) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 ;
  
  //(1 2 3) • (1 4 5) • (1 6 5) • (7 8 10) (7 9 10) • (11 12 14) (11 13 14) • (15 16 18) (15 17 18)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter5) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter18) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter17, stickerLetter18) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}

function getAlgorithm_OneFourCyclePlusNineTwoCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22) {
  
  //1 4-cycle + 9 2-cycles built from eleven 3-cycles - 2 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3) • (1 4 6) • (1 5 6) • (7 8 10) (7 9 10) • (11 12 14) (11 13 14) • (15 16 18) (15 17 18) • (19 20 22) (19 21 22)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter5, stickerLetter6) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter18) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter17, stickerLetter18) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter20, stickerLetter22) ;
  var algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter21, stickerLetter22) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 ;
  
  //(1 2 3) • (1 4 5) • (1 6 5) • (7 8 10) (7 9 10) • (11 12 14) (11 13 14) • (15 16 18) (15 17 18) • (19 20 22) (19 21 22)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter5) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter16, stickerLetter18) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter15, stickerLetter17, stickerLetter18) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter20, stickerLetter22) ;
  var algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter19, stickerLetter21, stickerLetter22) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwoFourCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8) {
  
  //2 4-cycles built from four 3-cycles – Optimized algorithm - 16 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4) (5 6 7 8) = (1 2 3) (1 4 6) (1 5 6) (5 7 8)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter6) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter5, stickerLetter6) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 3 4 1) (5 6 7 8) = (2 3 4) (2 1 6) (2 5 6) (5 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(3 4 1 2) (5 6 7 8) = (3 4 1) (3 2 6) (3 5 6) (5 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(4 1 2 3) (5 6 7 8) = (4 1 2) (4 3 6) (4 5 6) (5 7 8)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 3 4) (6 7 8 5) = (1 2 3) (1 4 7) (1 6 7) (6 8 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 3 4 1) (6 7 8 5) = (2 3 4) (2 1 7) (2 6 7) (6 8 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter6, stickerLetter7) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(3 4 1 2) (6 7 8 5) = (3 4 1) (3 2 7) (3 6 7) (6 8 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(4 1 2 3) (6 7 8 5) = (4 1 2) (4 3 7) (4 6 7) (6 8 5)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter6, stickerLetter7) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter8, stickerLetter5) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 3 4) (7 8 5 6) = (1 2 3) (1 4 8) (1 7 8) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 3 4 1) (7 8 5 6) = (2 3 4) (2 1 8) (2 7 8) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(3 4 1 2) (7 8 5 6) = (3 4 1) (3 2 8) (3 7 8) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(4 1 2 3) (7 8 5 6) = (4 1 2) (4 3 8) (4 7 8) (7 5 6)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter5, stickerLetter6) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(1 2 3 4) (8 5 6 7) = (1 2 3) (1 4 5) (1 8 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[12] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(2 3 4 1) (8 5 6 7) = (2 3 4) (2 1 5) (2 8 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter5) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter8, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[13] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(3 4 1 2) (8 5 6 7) = (3 4 1) (3 2 5) (3 8 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter5) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[14] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //(4 1 2 3) (8 5 6 7) = (4 1 2) (4 3 5) (4 8 5) (8 6 7)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter5) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter8, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter6, stickerLetter7) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "")) { algIsVoid = true; }
  algorithmArray[15] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 ;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwoSixCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12) {
  
  //2 6-cycles built from six 3-cycles – Optimized algorithm - 6 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6) (7 8 9 10 11 12) = (1 2 3) (1 4 5) (1 6 8) (1 7 8) (7 9 10) (7 11 12)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter8) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter7, stickerLetter8) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6;
  
  //(2 3 4 5 6 1) (7 8 9 10 11 12) = (2 3 4) (2 5 6) (2 1 8) (2 7 8) (7 9 10) (7 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6;
  
  //(3 4 5 6 1 2) (7 8 9 10 11 12) = (3 4 5) (3 6 1) (3 2 8) (3 7 8) (7 9 10) (7 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6;
  
  //(4 5 6 1 2 3) (7 8 9 10 11 12) = (4 5 6) (4 1 2) (4 3 8) (4 7 8) (7 9 10) (7 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6;
  
  //(5 6 1 2 3 4) (7 8 9 10 11 12) = (5 6 1) (5 2 3) (5 4 8) (5 7 8) (7 9 10) (7 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter4, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6;
  
  //(6 1 2 3 4 5) (7 8 9 10 11 12) = (6 1 2) (6 3 4) (6 5 8) (6 7 8) (7 9 10) (7 11 12)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwoEightCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16) {
  
  //2 8-cycles built from eight 3-cycles – Optimized algorithm - 6 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7 8) (9 10 11 12 13 14 15 16) = (1 2 3) (1 4 5) (1 6 7) (1 8 10) (1 9 10) (9 11 12) (9 13 14) (9 15 16)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter10) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter9, stickerLetter10) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(2 3 4 5 6 7 8 1) (9 10 11 12 13 14 15 16) = (2 3 4) (2 5 6) (2 7 8) (2 1 10) (2 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(3 4 5 6 7 8 1 2) (9 10 11 12 13 14 15 16) = (3 4 5) (3 6 7) (3 8 1) (3 2 10) (3 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(4 5 6 7 8 1 2 3) (9 10 11 12 13 14 15 16) = (4 5 6) (4 7 8) (4 1 2) (4 3 10) (4 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(5 6 7 8 1 2 3 4) (9 10 11 12 13 14 15 16) = (5 6 7) (5 8 1) (5 2 3) (5 4 10) (5 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter4, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(6 7 8 1 2 3 4 5) (9 10 11 12 13 14 15 16) = (6 7 8) (6 1 2) (6 3 4) (6 5 10) (6 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(7 8 1 2 3 4 5 6) (9 10 11 12 13 14 15 16) = (7 8 1) (7 2 3) (7 4 5) (7 6 10) (7 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter6, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //(8 1 2 3 4 5 6 7) (9 10 11 12 13 14 15 16) = (8 1 2) (8 3 4) (8 5 6) (8 7 10) (8 9 10) (9 11 12) (9 13 14) (9 15 16)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter7, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter15, stickerLetter16) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwoTenCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20) {
  
  //2 10-cycles built from ten 3-cycles – Optimized algorithm - 10 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7 8 9 10) (11 12 13 14 15 16 17 18 19 20) = (1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 12) (1 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter12) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter11, stickerLetter12) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(2 3 4 5 6 7 8 9 10 1) (11 12 13 14 15 16 17 18 19 20) = (2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 1 12) (2 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(3 4 5 6 7 8 9 10 1 2) (11 12 13 14 15 16 17 18 19 20) = (3 4 5) (3 6 7) (3 8 9) (3 10 1) (3 2 12) (3 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(4 5 6 7 8 9 10 1 2 3) (11 12 13 14 15 16 17 18 19 20) = (4 5 6) (4 7 8) (4 9 10) (4 1 2) (4 3 12) (4 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(5 6 7 8 9 10 1 2 3 4) (11 12 13 14 15 16 17 18 19 20) = (5 6 7) (5 8 9) (5 10 1) (5 2 3) (5 4 12) (5 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter4, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(6 7 8 9 10 1 2 3 4 5) (11 12 13 14 15 16 17 18 19 20) = (6 7 8) (6 9 10) (6 1 2) (6 3 4) (6 5 12) (6 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(7 8 9 10 1 2 3 4 5 6) (11 12 13 14 15 16 17 18 19 20) = (7 8 9) (7 10 1) (7 2 3) (7 4 5) (7 6 12) (7 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter6, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(8 9 10 1 2 3 4 5 6 7) (11 12 13 14 15 16 17 18 19 20) = (8 9 10) (8 1 2) (8 3 4) (8 5 6) (8 7 12) (8 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter7, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(9 10 1 2 3 4 5 6 7 8) (11 12 13 14 15 16 17 18 19 20) = (9 10 1) (9 2 3) (9 4 5) (9 6 7) (9 8 12) (9 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter8, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //(10 1 2 3 4 5 6 7 8 9) (11 12 13 14 15 16 17 18 19 20) = (10 1 2) (10 3 4) (10 5 6) (10 7 8) (10 9 12) (10 11 12) (11 13 14) (11 15 16) (11 17 18) (11 19 20)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter9, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter19, stickerLetter20) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getAlgorithm_TwoTwelveCycles(orbit, stickerLetter1, stickerLetter2, stickerLetter3, stickerLetter4, stickerLetter5, stickerLetter6, stickerLetter7, stickerLetter8, stickerLetter9, stickerLetter10, stickerLetter11, stickerLetter12, stickerLetter13, stickerLetter14, stickerLetter15, stickerLetter16, stickerLetter17, stickerLetter18, stickerLetter19, stickerLetter20, stickerLetter21, stickerLetter22, stickerLetter23, stickerLetter24) {
  
  //2 12-cycles built from twelve 3-cycles – Optimized algorithm - 12 cases
  var algorithmArray = new Array() ;
  var algIsVoid = false ;
  
  //(1 2 3 4 5 6 7 8 9 10 11 12) (13 14 15 16 17 18 19 20 21 22 23 24) = (1 2 3) (1 4 5) (1 6 7) (1 8 9) (1 10 11) (1 12 14) (1 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  var algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter2, stickerLetter3) ;
  var algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter4, stickerLetter5) ;
  var algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter6, stickerLetter7) ;
  var algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter8, stickerLetter9) ;
  var algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter10, stickerLetter11) ;
  var algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter12, stickerLetter14) ;
  var algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter1, stickerLetter13, stickerLetter14) ;
  var algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  var algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  var algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  var algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  var algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[0] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(2 3 4 5 6 7 8 9 10 11 12 1) (13 14 15 16 17 18 19 20 21 22 23 24) = (2 3 4) (2 5 6) (2 7 8) (2 9 10) (2 11 12) (2 1 14) (2 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter3, stickerLetter4) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter5, stickerLetter6) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter7, stickerLetter8) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter9, stickerLetter10) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter11, stickerLetter12) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter1, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter2, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[1] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(3 4 5 6 7 8 9 10 11 12 1 2) (13 14 15 16 17 18 19 20 21 22 23 24) = (3 4 5) (3 6 7) (3 8 9) (3 10 11) (3 12 1) (3 2 14) (3 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter4, stickerLetter5) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter6, stickerLetter7) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter8, stickerLetter9) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter10, stickerLetter11) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter12, stickerLetter1) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter2, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter3, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[2] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(4 5 6 7 8 9 10 11 12 1 2 3) (13 14 15 16 17 18 19 20 21 22 23 24) = (4 5 6) (4 7 8) (4 9 10) (4 11 12) (4 1 2) (4 3 14) (4 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter5, stickerLetter6) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter7, stickerLetter8) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter9, stickerLetter10) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter11, stickerLetter12) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter1, stickerLetter2) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter3, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter4, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[3] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(5 6 7 8 9 10 11 12 1 2 3 4) (13 14 15 16 17 18 19 20 21 22 23 24) = (5 6 7) (5 8 9) (5 10 11) (5 12 1) (5 2 3) (5 4 14) (5 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter6, stickerLetter7) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter8, stickerLetter9) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter10, stickerLetter11) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter12, stickerLetter1) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter2, stickerLetter3) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter4, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter5, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[4] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(6 7 8 9 10 11 12 1 2 3 4 5) (13 14 15 16 17 18 19 20 21 22 23 24) = (6 7 8) (6 9 10) (6 11 12) (6 1 2) (6 3 4) (6 5 14) (6 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter7, stickerLetter8) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter9, stickerLetter10) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter11, stickerLetter12) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter1, stickerLetter2) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter3, stickerLetter4) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter5, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter6, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[5] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(7 8 9 10 11 12 1 2 3 4 5 6) (13 14 15 16 17 18 19 20 21 22 23 24) = (7 8 9) (7 10 11) (7 12 1) (7 2 3) (7 4 5) (7 6 14) (7 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter8, stickerLetter9) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter10, stickerLetter11) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter12, stickerLetter1) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter2, stickerLetter3) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter4, stickerLetter5) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter6, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter7, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[6] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(8 9 10 11 12 1 2 3 4 5 6 7) (13 14 15 16 17 18 19 20 21 22 23 24) = (8 9 10) (8 11 12) (8 1 2) (8 3 4) (8 5 6) (8 7 14) (8 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter9, stickerLetter10) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter11, stickerLetter12) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter1, stickerLetter2) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter3, stickerLetter4) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter5, stickerLetter6) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter7, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter8, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[7] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(9 10 11 12 1 2 3 4 5 6 7 8) (13 14 15 16 17 18 19 20 21 22 23 24) = (9 10 11) (9 12 1) (9 2 3) (9 4 5) (9 6 7) (9 8 14) (9 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter10, stickerLetter11) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter12, stickerLetter1) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter2, stickerLetter3) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter4, stickerLetter5) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter6, stickerLetter7) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter8, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter9, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[8] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(10 11 12 1 2 3 4 5 6 7 8 9) (13 14 15 16 17 18 19 20 21 22 23 24) = (10 11 12) (10 1 2) (10 3 4) (10 5 6) (10 7 8) (10 9 14) (10 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter11, stickerLetter12) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter1, stickerLetter2) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter3, stickerLetter4) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter5, stickerLetter6) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter7, stickerLetter8) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter9, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter10, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[9] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(11 12 1 2 3 4 5 6 7 8 9 10) (13 14 15 16 17 18 19 20 21 22 23 24) = (11 12 1) (11 2 3) (11 4 5) (11 6 7) (11 8 9) (11 10 14) (11 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter12, stickerLetter1) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter2, stickerLetter3) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter4, stickerLetter5) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter6, stickerLetter7) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter8, stickerLetter9) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter10, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter11, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[10] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //(12 1 2 3 4 5 6 7 8 9 10 11) (13 14 15 16 17 18 19 20 21 22 23 24) = (12 1 2) (12 3 4) (12 5 6) (12 7 8) (12 9 10) (12 11 14) (12 13 14) (13 15 16) (13 17 18) (13 19 20) (13 21 22) (13 23 24)
  algorithm1 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter1, stickerLetter2) ;
  algorithm2 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter3, stickerLetter4) ;
  algorithm3 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter5, stickerLetter6) ;
  algorithm4 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter7, stickerLetter8) ;
  algorithm5 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter9, stickerLetter10) ;
  algorithm6 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter11, stickerLetter14) ;
  algorithm7 = getAlgorithm_ThreeCycle(orbit, stickerLetter12, stickerLetter13, stickerLetter14) ;
  algorithm8 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter15, stickerLetter16) ;
  algorithm9 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter17, stickerLetter18) ;
  algorithm10 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter19, stickerLetter20) ;
  algorithm11 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter21, stickerLetter22) ;
  algorithm12 = getAlgorithm_ThreeCycle(orbit, stickerLetter13, stickerLetter23, stickerLetter24) ;
  if ((algorithm1 == "") || (algorithm2 == "") || (algorithm3 == "") || (algorithm4 == "") || (algorithm5 == "") || (algorithm6 == "") || (algorithm7 == "") || (algorithm8 == "") || (algorithm9 == "") || (algorithm10 == "") || (algorithm11 == "") || (algorithm12 == "")) { algIsVoid = true; }
  algorithmArray[11] = algorithm1 + " " + algorithm2 + " " + algorithm3 + " " + algorithm4 + " " + algorithm5 + " " + algorithm6 + " " + algorithm7 + " " + algorithm8 + " " + algorithm9 + " " + algorithm10 + " " + algorithm11 + " " + algorithm12;
  
  //Error control: compound algorithm must be void if at least one of the returned algorithms is itself void
  if (algIsVoid == true) {
    var algorithm = "";
  } else {
    var algorithm = getShortestAlgorithm(algorithmArray);
  }
  
  return algorithm;
}


function getShortestAlgorithm(algorithmArray) {
  
  //Algorithm optimization: select the last found shortest algorithm
  var arrayLength = algorithmArray.length;
  var numberOfMovesMin = 32000 ;
  for (var iLoop = 0 ; iLoop < arrayLength ; iLoop++) {       
  var algorithm_Shortened = getShortenedAlgorithm(algorithmArray[iLoop]) ;
    var numberOfMoves = getNumberOfMoves(algorithm_Shortened) ;
    if (numberOfMoves <= numberOfMovesMin) {
      numberOfMovesMin = numberOfMoves ;
    var algorithm = algorithm_Shortened ;
    }
  }
  
  return algorithm ;
}


function getNumberOfMoves(algorithm) {
  
  //Get number of moves in a given algorithm string
  //Individual moves are separated with a single blank
  //Number of moves is obtained from number of blanks
  
  //Add a single blank to string
  var algorithm1 = " " + algorithm ;
  var algorithmLength1 = algorithm1.length ;
  
  var algorithm2 = algorithm1.replace(/ /g, "") ;
  var algorithmLength2 = algorithm2.length ;
  
  var numberOfBlanks = algorithmLength1 - algorithmLength2 ;
  var numberOfMoves = numberOfBlanks ;
  
  return numberOfMoves ;
}


function getShortenedAlgorithm(algorithm) {
  
  //Shorten algorithm length by cancellation/combination of successive move blocks
  
  //Add 1 leading plus 1 trailing blank to algorithm before shortening length
  var alg = " " + algorithm + " ";
  var numberOfPasses = 5 ;
  
  //Redo a number of times - 5 seems to be a good number of successive passes
  for (var iLoop = 0 ; iLoop < numberOfPasses ; iLoop++) { 
    alg = alg.replace(/ F F' /g, " ") ;
    alg = alg.replace(/ F' F /g, " ") ;
    alg = alg.replace(/ R R' /g, " ") ;
    alg = alg.replace(/ R' R /g, " ") ;
    alg = alg.replace(/ U U' /g, " ") ;
    alg = alg.replace(/ U' U /g, " ") ;
    alg = alg.replace(/ L L' /g, " ") ;
    alg = alg.replace(/ L' L /g, " ") ;
    alg = alg.replace(/ D D' /g, " ") ;
    alg = alg.replace(/ D' D /g, " ") ;
    alg = alg.replace(/ B B' /g, " ") ;
    alg = alg.replace(/ B' B /g, " ") ;
    alg = alg.replace(/ F F /g, " F2 ") ;
    alg = alg.replace(/ F' F' /g, " F2 ") ;
    alg = alg.replace(/ R R /g, " R2 ") ;
    alg = alg.replace(/ R' R' /g, " R2 ") ;
    alg = alg.replace(/ U U /g, " U2 ") ;
    alg = alg.replace(/ U' U' /g, " U2 ") ;
    alg = alg.replace(/ L L /g, " L2 ") ;
    alg = alg.replace(/ L' L' /g, " L2 ") ;
    alg = alg.replace(/ D D /g, " D2 ") ;
    alg = alg.replace(/ D' D' /g, " D2 ") ;
    alg = alg.replace(/ B B /g, " B2 ") ;
    alg = alg.replace(/ B' B' /g, " B2 ") ;
    alg = alg.replace(/ F F2 /g, " F' ") ;
    alg = alg.replace(/ F2 F /g, " F' ") ;
    alg = alg.replace(/ F' F2 /g, " F ") ;
    alg = alg.replace(/ F2 F' /g, " F ") ;
    alg = alg.replace(/ R R2 /g, " R' ") ;
    alg = alg.replace(/ R2 R /g, " R' ") ;
    alg = alg.replace(/ R' R2 /g, " R ") ;
    alg = alg.replace(/ R2 R' /g, " R ") ;
    alg = alg.replace(/ U U2 /g, " U' ") ;
    alg = alg.replace(/ U2 U /g, " U' ") ;
    alg = alg.replace(/ U' U2 /g, " U ") ;
    alg = alg.replace(/ U2 U' /g, " U ") ;
    alg = alg.replace(/ L L2 /g, " L' ") ;
    alg = alg.replace(/ L2 L /g, " L' ") ;
    alg = alg.replace(/ L' L2 /g, " L ") ;
    alg = alg.replace(/ L2 L' /g, " L ") ;
    alg = alg.replace(/ D D2 /g, " D' ") ;
    alg = alg.replace(/ D2 D /g, " D' ") ;
    alg = alg.replace(/ D' D2 /g, " D ") ;
    alg = alg.replace(/ D2 D' /g, " D ") ;
    alg = alg.replace(/ B B2 /g, " B' ") ;
    alg = alg.replace(/ B2 B /g, " B' ") ;
    alg = alg.replace(/ B' B2 /g, " B ") ;
    alg = alg.replace(/ B2 B' /g, " B ") ;
    alg = alg.replace(/ F2 F2 /g, " ") ;
    alg = alg.replace(/ R2 R2 /g, " ") ;
    alg = alg.replace(/ U2 U2 /g, " ") ;
    alg = alg.replace(/ L2 L2 /g, " ") ;
    alg = alg.replace(/ D2 D2 /g, " ") ;
    alg = alg.replace(/ B2 B2 /g, " ") ;
    alg = alg.replace(/ F B F' /g, " B ") ;
    alg = alg.replace(/ B F B' /g, " F ") ;
    alg = alg.replace(/ F' B F /g, " B ") ;
    alg = alg.replace(/ B F' B' /g, " F' ") ;
    alg = alg.replace(/ F B' F' /g, " B' ") ;
    alg = alg.replace(/ B' F B /g, " F ") ;
    alg = alg.replace(/ F' B' F /g, " B' ") ;
    alg = alg.replace(/ B' F' B /g, " F' ") ;
    alg = alg.replace(/ R L R' /g, " L ") ;
    alg = alg.replace(/ L R L' /g, " R ") ;
    alg = alg.replace(/ R' L R /g, " L ") ;
    alg = alg.replace(/ L R' L' /g, " R' ") ;
    alg = alg.replace(/ R L' R' /g, " L' ") ;
    alg = alg.replace(/ L' R L /g, " R ") ;
    alg = alg.replace(/ R' L' R /g, " L' ") ;
    alg = alg.replace(/ L' R' L /g, " R' ") ;
    alg = alg.replace(/ U D U' /g, " D ") ;
    alg = alg.replace(/ D U D' /g, " U ") ;
    alg = alg.replace(/ U' D U /g, " D ") ;
    alg = alg.replace(/ D U' D' /g, " U' ") ;
    alg = alg.replace(/ U D' U' /g, " D' ") ;
    alg = alg.replace(/ D' U D /g, " U ") ;
    alg = alg.replace(/ U' D' U /g, " D' ") ;
    alg = alg.replace(/ D' U' D /g, " U' ") ;
    alg = alg.replace(/ F2 B2 F /g, " B2 F' ") ;
    alg = alg.replace(/ F2 B2 F' /g, " B2 F ") ;
    alg = alg.replace(/ F2 B2 F2 /g, " B2 ") ;
    alg = alg.replace(/ B2 F2 B /g, " F2 B' ") ;
    alg = alg.replace(/ B2 F2 B' /g, " F2 B ") ;
    alg = alg.replace(/ B2 F2 B2 /g, " F2 ") ;
    alg = alg.replace(/ R2 L2 R /g, " L2 R' ") ;
    alg = alg.replace(/ R2 L2 R' /g, " L2 R ") ;
    alg = alg.replace(/ R2 L2 R2 /g, " L2 ") ;
    alg = alg.replace(/ L2 R2 L /g, " R2 L' ") ;
    alg = alg.replace(/ L2 R2 L' /g, " R2 L ") ;
    alg = alg.replace(/ L2 R2 L2 /g, " R2 ") ;
    alg = alg.replace(/ U2 D2 U /g, " D2 U' ") ;
    alg = alg.replace(/ U2 D2 U' /g, " D2 U ") ;
    alg = alg.replace(/ U2 D2 U2 /g, " D2 ") ;
    alg = alg.replace(/ D2 U2 D /g, " U2 D' ") ;
    alg = alg.replace(/ D2 U2 D' /g, " U2 D ") ;
    alg = alg.replace(/ D2 U2 D2 /g, " U2 ") ;
    alg = alg.replace(/ F B F2 /g, " B F' ") ;
    alg = alg.replace(/ B F B2 /g, " F B' ") ;
    alg = alg.replace(/ F' B F2 /g, " B F ") ;
    alg = alg.replace(/ B F' B2 /g, " F' B' ") ;
    alg = alg.replace(/ F B' F2 /g, " B' F' ") ;
    alg = alg.replace(/ B' F B2 /g, " F B ") ;
    alg = alg.replace(/ F' B' F2 /g, " B' F ") ;
    alg = alg.replace(/ B' F' B2 /g, " F' B ") ;
    alg = alg.replace(/ R L R2 /g, " L R' ") ;
    alg = alg.replace(/ L R L2 /g, " R L' ") ;
    alg = alg.replace(/ R' L R2 /g, " L R ") ;
    alg = alg.replace(/ L R' L2 /g, " R' L' ") ;
    alg = alg.replace(/ R L' R2 /g, " L' R' ") ;
    alg = alg.replace(/ L' R L2 /g, " R L ") ;
    alg = alg.replace(/ R' L' R2 /g, " L' R ") ;
    alg = alg.replace(/ L' R' L2 /g, " R' L ") ;
    alg = alg.replace(/ U D U2 /g, " D U' ") ;
    alg = alg.replace(/ D U D2 /g, " U D' ") ;
    alg = alg.replace(/ U' D U2 /g, " D U ") ;
    alg = alg.replace(/ D U' D2 /g, " U' D' ") ;
    alg = alg.replace(/ U D' U2 /g, " D' U' ") ;
    alg = alg.replace(/ D' U D2 /g, " U D ") ;
    alg = alg.replace(/ U' D' U2 /g, " D' U ") ;
    alg = alg.replace(/ D' U' D2 /g, " U' D ") ;
    alg = alg.replace(/ F2 B F /g, " B F' ") ;
    alg = alg.replace(/ B2 F B /g, " F B' ") ;
    alg = alg.replace(/ F2 B' F /g, " B' F' ") ;
    alg = alg.replace(/ B2 F B' /g, " F B ") ;
    alg = alg.replace(/ F2 B F' /g, " B F ") ;
    alg = alg.replace(/ B2 F' B /g, " F' B' ") ;
    alg = alg.replace(/ F2 B' F' /g, " B' F ") ;
    alg = alg.replace(/ B2 F' B' /g, " F' B ") ;
    alg = alg.replace(/ L2 R L /g, " R L' ") ;
    alg = alg.replace(/ R2 L R /g, " L R' ") ;
    alg = alg.replace(/ L2 R' L /g, " R' L' ") ;
    alg = alg.replace(/ R2 L R' /g, " L R ") ;
    alg = alg.replace(/ L2 R L' /g, " R L ") ;
    alg = alg.replace(/ R2 L' R /g, " L' R' ") ;
    alg = alg.replace(/ L2 R' L' /g, " R' L ") ;
    alg = alg.replace(/ R2 L' R' /g, " L' R ") ;
    alg = alg.replace(/ U2 D U /g, " D U' ") ;
    alg = alg.replace(/ D2 U D /g, " U D' ") ;
    alg = alg.replace(/ U2 D' U /g, " D' U' ") ;
    alg = alg.replace(/ D2 U D' /g, " U D ") ;
    alg = alg.replace(/ U2 D U' /g, " D U ") ;
    alg = alg.replace(/ D2 U' D /g, " U' D' ") ;
    alg = alg.replace(/ U2 D' U' /g, " D' U ") ;
    alg = alg.replace(/ D2 U' D' /g, " U' D ") ;
    alg = alg.replace(/ MF MF /g, " MF2 ") ;
    alg = alg.replace(/ MF' MF' /g, " MF2 ") ;
    alg = alg.replace(/ MR MR /g, " MR2 ") ;
    alg = alg.replace(/ MR' MR' /g, " MR2 ") ;
    alg = alg.replace(/ MU MU /g, " MU2 ") ;
    alg = alg.replace(/ MU' MU' /g, " MU2 ") ;
    alg = alg.replace(/ ML ML /g, " ML2 ") ;
    alg = alg.replace(/ ML' ML' /g, " ML2 ") ;
    alg = alg.replace(/ MD MD /g, " MD2 ") ;
    alg = alg.replace(/ MD' MD' /g, " MD2 ") ;
    alg = alg.replace(/ MB MB /g, " MB2 ") ;
    alg = alg.replace(/ MB' MB' /g, " MB2 ") ;
    alg = alg.replace(/ MF MF' /g, " ") ;
    alg = alg.replace(/ MF' MF /g, " ") ;
    alg = alg.replace(/ MR MR' /g, " ") ;
    alg = alg.replace(/ MR' MR /g, " ") ;
    alg = alg.replace(/ MU MU' /g, " ") ;
    alg = alg.replace(/ MU' MU /g, " ") ;
    alg = alg.replace(/ ML ML' /g, " ") ;
    alg = alg.replace(/ ML' ML /g, " ") ;
    alg = alg.replace(/ MD MD' /g, " ") ;
    alg = alg.replace(/ MD' MD /g, " ") ;
    alg = alg.replace(/ MB MB' /g, " ") ;
    alg = alg.replace(/ MB' MB /g, " ") ;
    alg = alg.replace(/ MF MF2 /g, " MF' ") ;
    alg = alg.replace(/ MF2 MF /g, " MF' ") ;
    alg = alg.replace(/ MR MR2 /g, " MR' ") ;
    alg = alg.replace(/ MR2 MR /g, " MR' ") ;
    alg = alg.replace(/ MU MU2 /g, " MU' ") ;
    alg = alg.replace(/ MU2 MU /g, " MU' ") ;
    alg = alg.replace(/ ML ML2 /g, " ML' ") ;
    alg = alg.replace(/ ML2 ML /g, " ML' ") ;
    alg = alg.replace(/ MD MD2 /g, " MD' ") ;
    alg = alg.replace(/ MD2 MD /g, " MD' ") ;
    alg = alg.replace(/ MB MB2 /g, " MB' ") ;
    alg = alg.replace(/ MB2 MB /g, " MB' ") ;
    alg = alg.replace(/ MF' MF2 /g, " MF ") ;
    alg = alg.replace(/ MF2 MF' /g, " MF ") ;
    alg = alg.replace(/ MR' MR2 /g, " MR ") ;
    alg = alg.replace(/ MR2 MR' /g, " MR ") ;
    alg = alg.replace(/ MU' MU2 /g, " MU ") ;
    alg = alg.replace(/ MU2 MU' /g, " MU ") ;
    alg = alg.replace(/ ML' ML2 /g, " ML ") ;
    alg = alg.replace(/ ML2 ML' /g, " ML ") ;
    alg = alg.replace(/ MD' MD2 /g, " MD ") ;
    alg = alg.replace(/ MD2 MD' /g, " MD ") ;
    alg = alg.replace(/ MB' MB2 /g, " MB ") ;
    alg = alg.replace(/ MB2 MB' /g, " MB ") ;
    alg = alg.replace(/ MF2 MF2 /g, " ") ;
    alg = alg.replace(/ MR2 MR2 /g, " ") ;
    alg = alg.replace(/ MU2 MU2 /g, " ") ;
    alg = alg.replace(/ ML2 ML2 /g, " ") ;
    alg = alg.replace(/ MD2 MD2 /g, " ") ;
    alg = alg.replace(/ MB2 MB2 /g, " ") ;
    alg = alg.replace(/ MF MB MF' /g, " MB ") ;
    alg = alg.replace(/ MF MB' MF' /g, " MB' ") ;
    alg = alg.replace(/ MF' MB MF /g, " MB ") ;
    alg = alg.replace(/ MF' MB' MF /g, " MB' ") ;
    alg = alg.replace(/ MB MF MB' /g, " MF ") ;
    alg = alg.replace(/ MB MF' MB' /g, " MF' ") ;
    alg = alg.replace(/ MB' MF MB /g, " MF ") ;
    alg = alg.replace(/ MB' MF' MB /g, " MF' ") ;
    alg = alg.replace(/ MR ML MR' /g, " ML ") ;
    alg = alg.replace(/ MR ML' MR' /g, " ML' ") ;
    alg = alg.replace(/ MR' ML MR /g, " ML ") ;
    alg = alg.replace(/ MR' ML' MR /g, " ML' ") ;
    alg = alg.replace(/ ML MR ML' /g, " MR ") ;
    alg = alg.replace(/ ML MR' ML' /g, " MR' ") ;
    alg = alg.replace(/ ML' MR ML /g, " MR ") ;
    alg = alg.replace(/ ML' MR' ML /g, " MR' ") ;
    alg = alg.replace(/ MU MD MU' /g, " MD ") ;
    alg = alg.replace(/ MU MD' MU' /g, " MD' ") ;
    alg = alg.replace(/ MU' MD MU /g, " MD ") ;
    alg = alg.replace(/ MU' MD' MU /g, " MD' ") ;
    alg = alg.replace(/ MD MU MD' /g, " MU ") ;
    alg = alg.replace(/ MD MU' MD' /g, " MU' ") ;
    alg = alg.replace(/ MD' MU MD /g, " MU ") ;
    alg = alg.replace(/ MD' MU' MD /g, " MU' ") ;
    alg = alg.replace(/ F B' /g, " SF ") ;
    alg = alg.replace(/ F' B /g, " SF' ") ;
    alg = alg.replace(/ R L' /g, " SR ") ;
    alg = alg.replace(/ R' L /g, " SR' ") ;
    alg = alg.replace(/ U D' /g, " SU ") ;
    alg = alg.replace(/ U' D /g, " SU' ") ;
    alg = alg.replace(/ SF SF' /g, "  ") ;
    alg = alg.replace(/ SF' SF /g, "  ") ;
    alg = alg.replace(/ SR SR' /g, "  ") ;
    alg = alg.replace(/ SR' SR /g, "  ") ;
    alg = alg.replace(/ SU SU' /g, "  ") ;
    alg = alg.replace(/ SU' SU /g, "  ") ;
    alg = alg.replace(/ NF NF /g, " NF2 ") ;
    alg = alg.replace(/ NF' NF' /g, " NF2 ") ;
    alg = alg.replace(/ NR NR /g, " NR2 ") ;
    alg = alg.replace(/ NR' NR' /g, " NR2 ") ;
    alg = alg.replace(/ NU NU /g, " NU2 ") ;
    alg = alg.replace(/ NU' NU' /g, " NU2 ") ;
    alg = alg.replace(/ NL NL /g, " NL2 ") ;
    alg = alg.replace(/ NL' NL' /g, " NL2 ") ;
    alg = alg.replace(/ ND ND /g, " ND2 ") ;
    alg = alg.replace(/ ND' ND' /g, " ND2 ") ;
    alg = alg.replace(/ NB NB /g, " NB2 ") ;
    alg = alg.replace(/ NB' NB' /g, " NB2 ") ;
    alg = alg.replace(/ NF NF' /g, " ") ;
    alg = alg.replace(/ NF' NF /g, " ") ;
    alg = alg.replace(/ NR NR' /g, " ") ;
    alg = alg.replace(/ NR' NR /g, " ") ;
    alg = alg.replace(/ NU NU' /g, " ") ;
    alg = alg.replace(/ NU' NU /g, " ") ;
    alg = alg.replace(/ NL NL' /g, " ") ;
    alg = alg.replace(/ NL' NL /g, " ") ;
    alg = alg.replace(/ ND ND' /g, " ") ;
    alg = alg.replace(/ ND' ND /g, " ") ;
    alg = alg.replace(/ NB NB' /g, " ") ;
    alg = alg.replace(/ NB' NB /g, " ") ;
    alg = alg.replace(/ NF NF2 /g, " NF' ") ;
    alg = alg.replace(/ NF2 NF /g, " NF' ") ;
    alg = alg.replace(/ NR NR2 /g, " NR' ") ;
    alg = alg.replace(/ NR2 NR /g, " NR' ") ;
    alg = alg.replace(/ NU NU2 /g, " NU' ") ;
    alg = alg.replace(/ NU2 NU /g, " NU' ") ;
    alg = alg.replace(/ NL NL2 /g, " NL' ") ;
    alg = alg.replace(/ NL2 NL /g, " NL' ") ;
    alg = alg.replace(/ ND ND2 /g, " ND' ") ;
    alg = alg.replace(/ ND2 ND /g, " ND' ") ;
    alg = alg.replace(/ NB NB2 /g, " NB' ") ;
    alg = alg.replace(/ NB2 NB /g, " NB' ") ;
    alg = alg.replace(/ NF' NF2 /g, " NF ") ;
    alg = alg.replace(/ NF2 NF' /g, " NF ") ;
    alg = alg.replace(/ NR' NR2 /g, " NR ") ;
    alg = alg.replace(/ NR2 NR' /g, " NR ") ;
    alg = alg.replace(/ NU' NU2 /g, " NU ") ;
    alg = alg.replace(/ NU2 NU' /g, " NU ") ;
    alg = alg.replace(/ NL' NL2 /g, " NL ") ;
    alg = alg.replace(/ NL2 NL' /g, " NL ") ;
    alg = alg.replace(/ ND' ND2 /g, " ND ") ;
    alg = alg.replace(/ ND2 ND' /g, " ND ") ;
    alg = alg.replace(/ NB' NB2 /g, " NB ") ;
    alg = alg.replace(/ NB2 NB' /g, " NB ") ;
    alg = alg.replace(/ NF2 NF2 /g, " ") ;
    alg = alg.replace(/ NR2 NR2 /g, " ") ;
    alg = alg.replace(/ NU2 NU2 /g, " ") ;
    alg = alg.replace(/ NL2 NL2 /g, " ") ;
    alg = alg.replace(/ ND2 ND2 /g, " ") ;
    alg = alg.replace(/ NB2 NB2 /g, " ") ;
    alg = alg.replace(/ NF NB NF' /g, " NB ") ;
    alg = alg.replace(/ NF NB' NF' /g, " NB' ") ;
    alg = alg.replace(/ NF' NB NF /g, " NB ") ;
    alg = alg.replace(/ NF' NB' NF /g, " NB' ") ;
    alg = alg.replace(/ NB NF NB' /g, " NF ") ;
    alg = alg.replace(/ NB NF' NB' /g, " NF' ") ;
    alg = alg.replace(/ NB' NF NB /g, " NF ") ;
    alg = alg.replace(/ NB' NF' NB /g, " NF' ") ;
    alg = alg.replace(/ NR NL NR' /g, " NL ") ;
    alg = alg.replace(/ NR NL' NR' /g, " NL' ") ;
    alg = alg.replace(/ NR' NL NR /g, " NL ") ;
    alg = alg.replace(/ NR' NL' NR /g, " NL' ") ;
    alg = alg.replace(/ NL NR NL' /g, " NR ") ;
    alg = alg.replace(/ NL NR' NL' /g, " NR' ") ;
    alg = alg.replace(/ NL' NR NL /g, " NR ") ;
    alg = alg.replace(/ NL' NR' NL /g, " NR' ") ;
    alg = alg.replace(/ NU ND NU' /g, " ND ") ;
    alg = alg.replace(/ NU ND' NU' /g, " ND' ") ;
    alg = alg.replace(/ NU' ND NU /g, " ND ") ;
    alg = alg.replace(/ NU' ND' NU /g, " ND' ") ;
    alg = alg.replace(/ ND NU ND' /g, " NU ") ;
    alg = alg.replace(/ ND NU' ND' /g, " NU' ") ;
    alg = alg.replace(/ ND' NU ND /g, " NU ") ;
    alg = alg.replace(/ ND' NU' ND /g, " NU' ") ;
    alg = alg.replace(/ N3F N3F /g, " N3F2 ") ;
    alg = alg.replace(/ N3F' N3F' /g, " N3F2 ") ;
    alg = alg.replace(/ N3R N3R /g, " N3R2 ") ;
    alg = alg.replace(/ N3R' N3R' /g, " N3R2 ") ;
    alg = alg.replace(/ N3U N3U /g, " N3U2 ") ;
    alg = alg.replace(/ N3U' N3U' /g, " N3U2 ") ;
    alg = alg.replace(/ N3L N3L /g, " N3L2 ") ;
    alg = alg.replace(/ N3L' N3L' /g, " N3L2 ") ;
    alg = alg.replace(/ N3D N3D /g, " N3D2 ") ;
    alg = alg.replace(/ N3D' N3D' /g, " N3D2 ") ;
    alg = alg.replace(/ N3B N3B /g, " N3B2 ") ;
    alg = alg.replace(/ N3B' N3B' /g, " N3B2 ") ;
    alg = alg.replace(/ N3F N3F' /g, " ") ;
    alg = alg.replace(/ N3F' N3F /g, " ") ;
    alg = alg.replace(/ N3R N3R' /g, " ") ;
    alg = alg.replace(/ N3R' N3R /g, " ") ;
    alg = alg.replace(/ N3U N3U' /g, " ") ;
    alg = alg.replace(/ N3U' N3U /g, " ") ;
    alg = alg.replace(/ N3L N3L' /g, " ") ;
    alg = alg.replace(/ N3L' N3L /g, " ") ;
    alg = alg.replace(/ N3D N3D' /g, " ") ;
    alg = alg.replace(/ N3D' N3D /g, " ") ;
    alg = alg.replace(/ N3B N3B' /g, " ") ;
    alg = alg.replace(/ N3B' N3B /g, " ") ;
    alg = alg.replace(/ N3F N3F2 /g, " N3F' ") ;
    alg = alg.replace(/ N3F2 N3F /g, " N3F' ") ;
    alg = alg.replace(/ N3R N3R2 /g, " N3R' ") ;
    alg = alg.replace(/ N3R2 N3R /g, " N3R' ") ;
    alg = alg.replace(/ N3U N3U2 /g, " N3U' ") ;
    alg = alg.replace(/ N3U2 N3U /g, " N3U' ") ;
    alg = alg.replace(/ N3L N3L2 /g, " N3L' ") ;
    alg = alg.replace(/ N3L2 N3L /g, " N3L' ") ;
    alg = alg.replace(/ N3D N3D2 /g, " N3D' ") ;
    alg = alg.replace(/ N3D2 N3D /g, " N3D' ") ;
    alg = alg.replace(/ N3B N3B2 /g, " N3B' ") ;
    alg = alg.replace(/ N3B2 N3B /g, " N3B' ") ;
    alg = alg.replace(/ N3F' N3F2 /g, " N3F ") ;
    alg = alg.replace(/ N3F2 N3F' /g, " N3F ") ;
    alg = alg.replace(/ N3R' N3R2 /g, " N3R ") ;
    alg = alg.replace(/ N3R2 N3R' /g, " N3R ") ;
    alg = alg.replace(/ N3U' N3U2 /g, " N3U ") ;
    alg = alg.replace(/ N3U2 N3U' /g, " N3U ") ;
    alg = alg.replace(/ N3L' N3L2 /g, " N3L ") ;
    alg = alg.replace(/ N3L2 N3L' /g, " N3L ") ;
    alg = alg.replace(/ N3D' N3D2 /g, " N3D ") ;
    alg = alg.replace(/ N3D2 N3D' /g, " N3D ") ;
    alg = alg.replace(/ N3B' N3B2 /g, " N3B ") ;
    alg = alg.replace(/ N3B2 N3B' /g, " N3B ") ;
    alg = alg.replace(/ N3F2 N3F2 /g, " ") ;
    alg = alg.replace(/ N3R2 N3R2 /g, " ") ;
    alg = alg.replace(/ N3U2 N3U2 /g, " ") ;
    alg = alg.replace(/ N3L2 N3L2 /g, " ") ;
    alg = alg.replace(/ N3D2 N3D2 /g, " ") ;
    alg = alg.replace(/ N3B2 N3B2 /g, " ") ;
    alg = alg.replace(/ N3F N3B N3F' /g, " N3B ") ;
    alg = alg.replace(/ N3F N3B' N3F' /g, " N3B' ") ;
    alg = alg.replace(/ N3F' N3B N3F /g, " N3B ") ;
    alg = alg.replace(/ N3F' N3B' N3F /g, " N3B' ") ;
    alg = alg.replace(/ N3B N3F N3B' /g, " N3F ") ;
    alg = alg.replace(/ N3B N3F' N3B' /g, " N3F' ") ;
    alg = alg.replace(/ N3B' N3F N3B /g, " N3F ") ;
    alg = alg.replace(/ N3B' N3F' N3B /g, " N3F' ") ;
    alg = alg.replace(/ N3R N3L N3R' /g, " N3L ") ;
    alg = alg.replace(/ N3R N3L' N3R' /g, " N3L' ") ;
    alg = alg.replace(/ N3R' N3L N3R /g, " N3L ") ;
    alg = alg.replace(/ N3R' N3L' N3R /g, " N3L' ") ;
    alg = alg.replace(/ N3L N3R N3L' /g, " N3R ") ;
    alg = alg.replace(/ N3L N3R' N3L' /g, " N3R' ") ;
    alg = alg.replace(/ N3L' N3R N3L /g, " N3R ") ;
    alg = alg.replace(/ N3L' N3R' N3L /g, " N3R' ") ;
    alg = alg.replace(/ N3U N3D N3U' /g, " N3D ") ;
    alg = alg.replace(/ N3U N3D' N3U' /g, " N3D' ") ;
    alg = alg.replace(/ N3U' N3D N3U /g, " N3D ") ;
    alg = alg.replace(/ N3U' N3D' N3U /g, " N3D' ") ;
    alg = alg.replace(/ N3D N3U N3D' /g, " N3U ") ;
    alg = alg.replace(/ N3D N3U' N3D' /g, " N3U' ") ;
    alg = alg.replace(/ N3D' N3U N3D /g, " N3U ") ;
    alg = alg.replace(/ N3D' N3U' N3D /g, " N3U' ") ;
    alg = alg.replace(/ CF CF' /g, "  ") ;
    alg = alg.replace(/ CR CR' /g, "  ") ;
    alg = alg.replace(/ CU CU' /g, "  ") ;
    alg = alg.replace(/ CF' CF /g, "  ") ;
    alg = alg.replace(/ CR' CR /g, "  ") ;
    alg = alg.replace(/ CU' CU /g, "  ") ;
    alg = alg.replace(/ CF CF /g, " CF2 ") ;
    alg = alg.replace(/ CR CR /g, " CR2 ") ;
    alg = alg.replace(/ CU CU /g, " CU2 ") ;
    alg = alg.replace(/ CF' CF' /g, " CF2 ") ;
    alg = alg.replace(/ CR' CR' /g, " CR2 ") ;
    alg = alg.replace(/ CU' CU' /g, " CU2 ") ;
    alg = alg.replace(/ CF CF2 /g, " CF' ") ;
    alg = alg.replace(/ CR CR2 /g, " CR' ") ;
    alg = alg.replace(/ CU CU2 /g, " CU' ") ;
    alg = alg.replace(/ CF' CF2 /g, " CF ") ;
    alg = alg.replace(/ CR' CR2 /g, " CR ") ;
    alg = alg.replace(/ CU' CU2 /g, " CU ") ;
    alg = alg.replace(/ CF2 CF /g, " CF' ") ;
    alg = alg.replace(/ CR2 CR /g, " CR' ") ;
    alg = alg.replace(/ CU2 CU /g, " CU' ") ;
    alg = alg.replace(/ CF2 CF' /g, " CF ") ;
    alg = alg.replace(/ CR2 CR' /g, " CR ") ;
    alg = alg.replace(/ CU2 CU' /g, " CU ") ;
    alg = alg.replace(/ B SF /g, " F ") ;
    alg = alg.replace(/ L SR /g, " R ") ;
    alg = alg.replace(/ D SU /g, " U ") ;
    alg = alg.replace(/ SF B /g, " F ") ;
    alg = alg.replace(/ SR L /g, " R ") ;
    alg = alg.replace(/ SU D /g, " U ") ;
    alg = alg.replace(/ F' SF /g, " B' ") ;
    alg = alg.replace(/ R' SR /g, " L' ") ;
    alg = alg.replace(/ U' SU /g, " D' ") ;
    alg = alg.replace(/ SF F' /g, " B' ") ;
    alg = alg.replace(/ SR R' /g, " L' ") ;
    alg = alg.replace(/ SU U' /g, " D' ") ;
    alg = alg.replace(/ F SF' /g, " B ") ;
    alg = alg.replace(/ R SR' /g, " L ") ;
    alg = alg.replace(/ U SU' /g, " D ") ;
    alg = alg.replace(/ SF' F /g, " B ") ;
    alg = alg.replace(/ SR' R /g, " L ") ;
    alg = alg.replace(/ SU' U /g, " D ") ;
    alg = alg.replace(/ B' SF' /g, " F' ") ;
    alg = alg.replace(/ L' SR' /g, " R' ") ;
    alg = alg.replace(/ D' SU' /g, " U' ") ;
    alg = alg.replace(/ SF' B' /g, " F' ") ;
    alg = alg.replace(/ SR' L' /g, " R' ") ;
    alg = alg.replace(/ SU' D' /g, " U' ") ;
    alg = alg.replace(/ B' F /g, " SF ") ;
    alg = alg.replace(/ B F' /g, " SF' ") ;
    alg = alg.replace(/ L' R /g, " SR ") ;
    alg = alg.replace(/ L R' /g, " SR' ") ;
    alg = alg.replace(/ D' U /g, " SU ") ;
    alg = alg.replace(/ D U' /g, " SU' ") ;
  }
  
  //Remove leading and trailing blanks
  alg = trimString(alg);
  
  return alg ;
}


function trimString(alg) {
  
  //Trim left
  while (alg.substring(0, 1) == " ") {
    alg = alg.substring(1, alg.length);
  }
  //Trim right
  while (alg.substring(alg.length - 1, alg.length) == " ") {
    alg = alg.substring(0, alg.length - 1);
  }
  return alg;
}
