added rudimentary accelerometer control code