modify code style. compact vertically, expand horizontally

- fix indentations
- squash structures
- ensure whitespace around operators and various control statements