Adding fitness calculation method.