Added accelerometer functionality.