added accelerometer detection