added calculation for finding fitness