add helper function computeFitness