Index: framspy/evolalg/base/experiment_abc.py
===================================================================
--- framspy/evolalg/base/experiment_abc.py	(revision 1191)
+++ framspy/evolalg/base/experiment_abc.py	(revision 1194)
@@ -40,5 +40,5 @@
         new_individual = Individual()
         new_individual.set_and_evaluate(genotype, self.evaluate)
-        if new_individual.fitness is not BAD_FITNESS:  # this is how we defined BAD_FITNESS in evaluate()
+        if new_individual.fitness is not BAD_FITNESS:
             ind_list.append(new_individual)
 
@@ -46,34 +46,26 @@
         """'individuals' is the input population (a list of individuals).
         Assumptions: all genotypes in 'individuals' are valid and evaluated (have fitness set).
-        Returns: a new population of the same size as 'individuals' with prob_mut mutants, prob_xov offspring, and the remainder of clones."""
+        Returns: a new population of size 'self.popsize' with prob_mut mutants, prob_xov offspring, and the remainder of clones."""
 
         newpop = []
-        N = len(individuals)
-        expected_mut = int(N * prob_mut)
-        expected_xov = int(N * prob_xov)
-        assert expected_mut + \
-            expected_xov <= N, "If probabilities of mutation (%g) and crossover (%g) added together exceed 1.0, then the population would grow every generation..." % (
-                prob_mut, prob_xov)
-        ris = RandomIndexSequence(N)
+        expected_mut = int(self.popsize * prob_mut)
+        expected_xov = int(self.popsize * prob_xov)
+        assert expected_mut + expected_xov <= self.popsize, "If probabilities of mutation (%g) and crossover (%g) added together exceed 1.0, then the population would grow every generation..." % (prob_mut, prob_xov)
+        ris = RandomIndexSequence(len(individuals))
 
         # adding valid mutants of selected individuals...
         while len(newpop) < expected_mut:
-            ind = self.select(
-                individuals, tournament_size=tournament_size, random_index_sequence=ris)
+            ind = self.select(individuals, tournament_size=tournament_size, random_index_sequence=ris)
             self.addGenotypeIfValid(newpop, self.mutate(ind.genotype))
 
         # adding valid crossovers of selected individuals...
         while len(newpop) < expected_mut + expected_xov:
-            ind1 = self.select(
-                individuals, tournament_size=tournament_size, random_index_sequence=ris)
-            ind2 = self.select(
-                individuals, tournament_size=tournament_size, random_index_sequence=ris)
-            self.addGenotypeIfValid(
-                newpop, self.cross_over(ind1.genotype, ind2.genotype))
+            ind1 = self.select(individuals, tournament_size=tournament_size, random_index_sequence=ris)
+            ind2 = self.select(individuals, tournament_size=tournament_size, random_index_sequence=ris)
+            self.addGenotypeIfValid(newpop, self.cross_over(ind1.genotype, ind2.genotype))
 
         # select clones to fill up the new population until we reach the same size as the input population
-        while len(newpop) < len(individuals):
-            ind = self.select(
-                individuals, tournament_size=tournament_size, random_index_sequence=ris)
+        while len(newpop) < self.popsize:
+            ind = self.select(individuals, tournament_size=tournament_size, random_index_sequence=ris)
             newpop.append(Individual().copyFrom(ind))
 
Index: framspy/evolalg/base/experiment_niching_abc.py
===================================================================
--- framspy/evolalg/base/experiment_niching_abc.py	(revision 1191)
+++ framspy/evolalg/base/experiment_niching_abc.py	(revision 1194)
@@ -28,7 +28,7 @@
         ExperimentABC.__init__(self,popsize=popsize, hof_size=hof_size, save_only_best=save_only_best)
         self.fit = fit
+        self.normalize = normalize
         self.knn_niching = knn_niching
         self.knn_nslc = knn_nslc
-        self.normalize = normalize
         self.archive_size=archive_size
         if popsize < self.knn_niching:
@@ -72,5 +72,5 @@
         else:
             raise Exception("Wrong fit type: ", self.fit,
-                            f" chose correct one or implement new behaviour")
+                            f" chose correct one or implement new behavior")
         population_structures.update_archive(dissim_matrix, population_archive)
 
@@ -98,19 +98,19 @@
 
     def make_new_population_nsga2(self, population, prob_mut, prob_xov):
-        N = len(population)
-        expected_mut = int(N * prob_mut)
-        expected_xov = int(N * prob_xov)
+        expected_mut = int(self.popsize * prob_mut)
+        expected_xov = int(self.popsize * prob_xov)
+        assert expected_mut + expected_xov <= self.popsize, "If probabilities of mutation (%g) and crossover (%g) added together exceed 1.0, then the population would grow every generation..." % (prob_mut, prob_xov)
         assignCrowdingDist(population)
-        offspring = tools.selTournamentDCD(population, N)
+        offspring = tools.selTournamentDCD(population, self.popsize)
 
         def addGenotypeIfValid(ind_list, genotype):
             new_individual = Individual()
             new_individual.set_and_evaluate(genotype, self.evaluate)
-            if new_individual.fitness is not BAD_FITNESS:  # this is how we defined BAD_FITNESS in frams_evaluate()
+            if new_individual.fitness is not BAD_FITNESS:
                 ind_list.append(new_individual)
 
         counter = 0
 
-        def get_indyvidual(pop, c):
+        def get_individual(pop, c):
             if c < len(pop):
                 ind = pop[c]
@@ -125,17 +125,16 @@
         newpop = []
         while len(newpop) < expected_mut:
-            ind, counter = get_indyvidual(offspring, counter)
+            ind, counter = get_individual(offspring, counter)
             addGenotypeIfValid(newpop, self.mutate(ind.genotype))
 
         # adding valid crossovers of selected individuals...
         while len(newpop) < expected_mut + expected_xov:
-            ind1, counter = get_indyvidual(offspring, counter)
-            ind2, counter = get_indyvidual(offspring, counter)
-            addGenotypeIfValid(newpop, self.cross_over(
-                ind1.genotype, ind2.genotype))
+            ind1, counter = get_individual(offspring, counter)
+            ind2, counter = get_individual(offspring, counter)
+            addGenotypeIfValid(newpop, self.cross_over(ind1.genotype, ind2.genotype))
 
         # select clones to fill up the new population until we reach the same size as the input population
         while len(newpop) < len(population):
-            ind, counter = get_indyvidual(offspring, counter)
+            ind, counter = get_individual(offspring, counter)
             newpop.append(Individual().copyFrom(ind))
 
@@ -194,5 +193,5 @@
                             help="What normalization use for dissimilarity matrix, max (default}, sum and none")
         parser.add_argument("-knn",type= int, default= 0,
-                        help="Nearest neighbours parameter for local novelty/niching, if knn==0 global is performed.Default:0")
+                        help="Nearest neighbors parameter for local novelty/niching, if knn==0 global is performed.Default:0")
         return parser 
         
