Changed iteration and genetic logic.