Added/improved comments throughout