Genetic algorithm for assignment 1