Some cleanup and lots of comments