Fixed some formatting

Updated it so everything was inline, braces and indentation matched up etc. to make more readable.