implement for accelerometer code