added accelerometer support