the actual logic for parsing accelerometer data and gravity data should be within their own functions.