minor cleanup, lots of commenting