fixing indenting, whitespace and variable names