Further second algorithm cleanup.