implemented method 1 of doing selection mutation and crossover