calibrate button works.

some if else statesments were changed to if elseif statements to avoid
potential errors.