Code documentation revised. Added additional comments.