fixes whitespace, and general code clean up