fix syntax errors and clean up white space issues