Added many comments to mapping code.  Minor code cleanup.