Add setFitness method and fix boundary bouncing