It took longer than probably anyone expected, but veteran Elementary is safely on the CBS schedule for the 2017-2018 season. CBS tonight has renewed the series for a sixth season and also picked up its reality series staple The Amazing Race.

Primetime-Panic Your Complete Guide to Pilots and Straight-to-Series orders See All

Elementary and The Amazing Race surprisingly did not make the list of early CBS renewals for the first time, spending their first spring on the bubble. But there never was serious doubt for the crime drama, 100% owned by CBS, which had been making writer staffing deals for next season, and for the most heralded reality series of the past decade.

While its linear ratings in the Sunday 10 PM hour are soft (7.4 million viewers, 1.2 in 18-49 Live+7), Elementary has off-network and SVOD deals with WGN America, Hulu Plus and broadcast stations that fetch in as much as $3 million total per episode; and it is a nice international seller too. Just last May, CBS Corp. CEO Les Moonves used Elementary as an example of a program ownership success story, telling investors that the show had “made approximately an $80 million profit for the corporation” the previous year.

Amazing Race, which also was not among the 11 returning and five freshman series that were renewed back in March, is having only one installment this season for the first time since the Emmy heavyweight’s 2001 debut. The veteran aired in the Friday 8 PM slot recently but the network found success this season with MacGyver in the hour, which has invigorated the entire night. Still, Race is a legacy series for the network, a 15-time Emmy winner.

The renewals follow CBS’ cancelation of 2 Broke Girls after six seasons, and earlier today The Great Indoors after one season.