Fix weird double variable declaration.

It seemed to run fine even with this.
Remove misleading comments.

There is more than just sorting going on here; it's also whether some
output is written.
Formatting.