New algorithm which doesn't require %reverse.