fixes some whitespacing, one-lines some extraneous if statements, formats whitespaces to be vim-compliant :)