Cleaning things up, adding some comments.