Add comments and basic cleanup.