After New York's West Side terrorist attack on Halloween, President Trump noted that the killer had entered through the diversity-visa lottery and that this was a bad policy.

While I don't think there's much of a causal connection between this visa program and terrorism, it is a dumb policy. More than 6.5 billion people live outside the U.S. A huge portion of them would love to live in the U.S., because the U.S. is the greatest country in the world. We can't let them all in, but shouldn't we work to get the best and the brightest?

Sen. Jeff Flake pointed out that this change was part of the much-maligned Gang of 8 immigration bill during the Obama years:

"Comprehensive immigration reform" is a constant mantra in Washington, and has been for a decade. It's politically toxic, though, because it always includes something like amnesty for illegal immigrants.

So here's a modest proposal: Let's do modest, targeted immigration reform.

Abolish the diversity lottery and replace it with a system for merit-based immigration. There will be plenty to debate here, specifically, how to determine merit, and where to set the numbers. A good compromise is to keep the numbers steady—a one-for-one swap between diversity visas and merit-based visas.

Don't load it up with walls, border enforcement, amnesty, or anything else. Just a small deal. Call it the Flake-Trump bill. Trade diversity visas for merit-based visas.