Raleigh and the Triangle trail all but seven of the 20 finalists for the Amazon HQ2 location in a study by CNBC that gives each a grade. CNBC gave Raleigh and three other locations a B, compared with an A- for Dallas and Austin, which top their ranking.

Amazon has said it will name the location for its coveted second headquarters this year that will employ 50,000 people, many in high paying corporate jobs. Rumors say it may narrow the finalists list by September. A total of 248 locations from Canada to Mexico submitted bids.

CNBC used data from its 12th America’s Top States for Business study to grade the locations based on Amazon’s criteria.

The company cited four main criteria for the new location:

Metropolitan areas with more than 1 million people.

A stable and business-friendly environment.

Urban or suburban locations with the potential to attract and retain strong technical talent.

Communities that think big and creatively when considering locations and real estate options.

All of the finalist sites got As for population, but varied widely on other criteria.

While noting that “Raleigh has been attracting top tech talent for decades,” CNBC chided North Carolina for its “relative lack of antidiscrimination protections,” despite the repeal of most provisions of its controversial “bathroom bill.” It adds that Governor Roy Cooper has signed executive orders intended to promote inclusiveness, but that the political environment “is anything but stable.”

It awards the state an A+ for population; a B+ for stability; a B for talent, and only a C+ for location.

Dallas and Austin, the HQ2 report card says, offer the same Texas advantages: great infrastructure, a strong and stable economy, worldclass workforce, no corporate income tax, and air travel options.

They also share the disadvantages of Texas, according to the study, “when it comes to quality of life and cost.” It also has a relative lack of science, technology, engineering and math workers “Amazon craves.” Austin also has high property taxes.

Nevertheless, it points out that Texas has the nation’s best all around state economy. Austin also offers “a legendary tech scene fed by the states flagship university and a vibe tech talent can love.”

Locations earning a B+ in the study were: Atlanta, Boston, Denver, Miami, Nashville and Northern Virginia.

Those sharing a B with Raleigh were: Columbus, Ohio, Indianapolis, and Los Angeles.

B- grades went to Chicago, Montgomery County, Maryland, New York, Philadelphia, Pittsburgh, Toronto, and Washington, DC.

Newark, New Jersey collected a C+, the only one earning less than a B-, despite offering a package worth at least $7 billion to lure the retail giant to the Garden State. CNBC writes, however, that Amazon would have to overlook the state’s drawbacks, such as high costs, crumbling infrastructure and business regulations.

Also see: