added/improved comments; added package/file description; rewrote debug p...

added/improved comments; added package/file description; rewrote debug p...