Improved Coding style

Some improved coding style for clarity of code (space before curly
brackets, space before and after operators, indent levels). Still much
more to be fixed
More coding style changes

further style improvements