Update logic for calculating position with accelerometer