Inserted functions to initialize the accelerometer and read x,y and z values