Code restructure and added automatic level control via the accelerometer.
Still not perfect but much beter than the previous version