adding the accelerometer function to the app