Fixing bug in genetic_algo