working with accelerometer