fixed identing, added comments, corrected spelling, etc.