Fixed algorithm so it's actually genetic.