void move(measure, measureNumber, space) { measure = getMeasure(measureNumber); // Get the measure itself as a variable moveMeasure(measureNumber, space); // Run the function(s) to physically move the measure (regardless of whether or not the measure can still be compressed, the current measure has to be moved. if(!measure.maxCompress) { // Check the boolean 'maxCompress' for the measure selected to see if it's not true to see if it can be compressed. int spaceLeft = compressMeasure(measureNumber, space); // The function to actually compress the measure could also return the space leftover that still needs to be allocated for the change. if(spaceLeft > 0) { // Check if there is still space to be allocated for the measure size move(measureNumber + 1, space); // Call THIS function for the next measure } } else { move(measureNumber + 1, space); // Call THIS function for the next measure } }