more cleanup and comments.