adjusted some accelerometer_record code for readability