Updated assignment with mean value of crossing stateB first time.