fixed an error with calculating fitness