Added case based version of updateState called updateSpeed