Improve comments. Reorder some statements for slightly better
performance.