fixed indentation and some minor cleanup