Added flycheck, and cleaned up some code.