This is the old, faster (But less accurate) scanning code.