Added accelerometer plugin and update function