added a few comments and other minor changes