The 2016-2017 Oklahoma City Thunder were a reasonably decent basketball team that won 47 games and made the playoffs with the league’s Most Valuable Player. Considering the team lost Kevin Durant before the start of the season and had to scramble to ensure a short-term commitment from Russell Westbrook, that wasn’t a terrible outcome. But it wasn’t good enough either.

It wasn’t good enough because the clock was ticking on Westbrook’s contract and without his signature on a max deal, the Thunder would be starting over from scratch. Those were the parameters under which Sam Presti worked this offseason and he understood the situation clearly.

While the league was waiting for the Celtics or Lakers to make a move on Paul George, Presti swooped in with an offer that included Victor Oladipo and Domantas Sabonis. When everyone was waiting for the Rockets and Knicks to pull the trigger on a deal for Carmelo Anthony, Presti snuck in and landed Melo for Enes Kanter and the leftover remains of a trade deadline deal with the Bulls.

You can argue over whether Pesti was fortunate that the Pacers shortchanged themselves in the George trade, or whether he was lucky that those Houston talks hit a snag. He was on both counts. Yet, in both instances, Presti got his man and reinforced to Westbrook that Oklahoma City was going to remain a serious contender.

The cherry on top came late Friday with word from Adrian Wojnarowski that Westbrook had agreed to a 5-year, $205 million extension. With that bit of news, the Thunder general manager can claim victory over an offseason that was fraught with peril.

It will be fascinating to see how all of this plays out on the court. Westbrook took the league by storm without a co-star last season, averaging a triple-double and winning the MVP over a competitive field that included James Harden, Kawhi Leonard, and LeBron James. The limits of that approach were spelled out in a first-round series loss to the Rockets.

Westbrook will have to give a little now that he’s playing with George and Melo, and they in turn will have to adjust to playing with him. This could all go smashingly well or be uncomfortably awkward. It could all go well and still not be good enough to seriously challenge Golden State, to say nothing of Houston and San Antonio. But OKC is still in the game and that was Presti’s mandate this summer.

His work is hardly over. George and Anthony can both be free agents after this season. The Thunder will be staring at a massive luxury tax bill, the kind of tax bill that ultimately forced Presti to deal Harden after the team’s lone Finals run in 2012. There will be enormous pressure on everyone in Oklahoma City to make this succeed. That includes coach Billy Donovan and the trio’s supporting cast. Those are good problems to have.

All of this comes at a time when the league has decided to make incremental changes to the lottery system. The rewards for bottoming out are fewer and the path to acquiring transcendent talent has become a little bit tougher. For a team in a small market like Oklahoma City, that raises the stakes on building and maintaining a competitive environment.

Presti has done that during his time in OKC. Working primarily through the draft, he has acquired not just great players like Westbrook, KD, and Harden, but useful players who can fill roles and become attractive trade targets.

Presti lobbied against more dramatic lottery changes last season, arguing that smaller markets will be at a greater disadvantage. Yet, winning is the ultimate recruiting pitch in the NBA, especially as the glamour markets of Los Angeles, New York, and Chicago have all taken steps back.

In a sense, trading for Melo was akin to landing a prime free agent, since Anthony had to agree to waive his no-trade clause. That isn’t possible without Russ and George already in place. Sam Presti has done what he can to ensure that the Thunder remain competitive. For that, he may be the biggest winner of all this summer.