Added comments and cosmetic modifications