Reformatting variables and stopping flashlight onStop