add braces for conditionals and fix indents