Remove some trailing whitespace.
Use better iterator names and document some final stuff.