tidyup

Found the indenting and bracketing quite confusing. Tidied it so the code is easier to read.
No functional changes.