change fitness function to be global