more comment and formatting fixes, small simplifications