attempted fix for accelerometer calibration function