added accelerometer data fetching code