Add lots of comments. Little bit of code cleanup.