code: private void sort(Matrix C, Vector E) {
          int i, j;
          double value;
          boolean changed;
          do {
              changed = false;
              for (i = 1; i < E.size; i++)
                  if (E.vector[i - 1] > E.vector[i]) {
                      value = E.vector[i];
                      E.vector[i] = E.vector[i - 1];
                      E.vector[i - 1] = value;
  
                      for (j = 0; j < C.rows; j++) {
                          value = C.matrix[j][i];
                          C.matrix[j][i] = C.matrix[j][i - 1];
                          C.matrix[j][i - 1] = value;
                      }
                      changed = true;
                  }
          } while (changed);
      }
docs: Sorts the orbitals by their energies