did a bunch of commenting, and a little refactoring