style fixes and smarter commenting