Added polling code for accelerometer