added battery calibration