Modular code is better than not modular code. Also changed the frequency for checking accel data.