added a few comments; various cosmetic changes