Clean Smith algorithms a bit.