Tweaking Accelerometer code