I practically rewrote the entire app and I almost hit reset on git. Phew.