Added code for graphing the accelerometer reading and switch