changed the main function to be a function called genetic algorithm. The new main function calls genetic algorithm a number of times and finds the average generations taken