Mostly removing obsolete comment from the original source. Also removing some unnecessary C-style for loops.