Coding style fixes

tabs to spaces
reindent
bracked on there own line
add/remove spaces where needed