Mark J. Terrill/Associated Press

LOS ANGELES — It's been almost two weeks since the New Orleans Pelicans agreed to trade Anthony Davis to the Los Angeles Lakers. What immediately followed was consternation and confusion that the Lakers may have mishandled the negotiation, losing track of the necessary cap room to sign an additional max-salary free agent in July.

The key to the first phase of the deal was sending out enough salary to the Pelicans that the Lakers could take on Davis' $27.1 million contract. And while they were certainly giving up a lot in the deal—Lonzo Ball, Brandon Ingram, Josh Hart, No. 4 pick De'Andre Hunter and future draft considerations— that wasn't enough to land Davis without dipping into their precious cap room.

The key to the second phase was Davis waiving part or all of his $4.1 million trade bonus to allow the Lakers more flexibility to acquire additional help, which he will reportedly do, per ESPN's Adrian Wojnarowski. The Washington Wizards also agreed to take on Mo Wagner, Isaac Bonga and Jemerrio Jones from the Lakers in what will go down as a three-team trade, according to Wojnarowski.

Now, despite the roadblocks the team may have faced initially, L.A. can move a total of six players under contract to acquire Davis after the franchise uses up to $32 million in cap space.

The max for Kawhi Leonard, Kyrie Irving and Jimmy Butler projects to be $32.7 million—awfully close to what the Lakers can offer—while D'Angelo Russell tops out at $27.3 million.

Leonard, the current NBA Finals Most Valuable Player and the Lakers' prized target, may stay with the Toronto Raptors. He may join the Los Angeles Clippers or another franchise. But with the Lakers, he would have the chance to team up with LeBron James and Davis on a team that should be an instant contender.

Mark Blinch/Getty Images

In that scenario, the Lakers would have just four players after including Kyle Kuzma—five with No. 46 pick Talen Horton-Tucker—but they would have only their $4.8 million room exception to add to the roster, after which they would be limited to minimum contracts.

The star-focused plan holds if the Lakers are instead able to lure Irving (although the buzz suggests he's heading to the Brooklyn Nets) or Kemba Walker (seemingly bound for the Boston Celtics, per Wojnarowski). Jimmy Butler could re-sign with the Philadelphia 76ers, join the Clippers or possibly serve as a fallback option for the Lakers.

Leonard may be the only star player listed who is undeniably worth the investment of all Los Angeles' spending power.

The Lakers could use a trick perfected by the Miami Heat in 2017: signing multiple players to unlikely incentives to lower their cap number.

Because the Lakers didn't make the playoffs this past season, Russell could earn a base salary of $20 million with a $3 million unlikely bonus dependent on Los Angeles advancing to the postseason. As long as the team hits that mark, he would get his additional money while the Lakers would still have about $13 million to either go after a center or possibly pursue defensive-minded guard Patrick Beverley. Lower Russell to a $17.4 million base with a 15 percent incentive and he'd earn $20 million, but the team would still have another $15.5 million to spend.

Chris Szagola/Associated Press

The salary-cap trick doesn't work if the Lakers max out just one player, but it's one that can be utilized multiple times to help them use every penny of their space.

Given how much the team is parting with to land Davis, it'll need to have a strong summer—strong with regards to both which players they choose to sign and how they get those deals done.

For instance, the Lakers issued qualifying offers to both Alex Caruso and Johnathan Williams on Wednesday. Caruso will take up $1.6 million of the team's cap space as a restricted free agent. If he's willing to return on a minimum contract, the Lakers could agree to terms with him, then revoke his qualifying offer and renounce his rights to remove his cap hold. After using all their cap space and officially trading for Davis, they could re-sign him. In a year's time, he would regain his full rights and be eligible for a bigger contract next summer.

Williams is a non-issue since he is finishing up a one-year two-way contract. If he accepts the Lakers' offer, he'll play on a two-way contract yet again.

Elsewhere, the team would need to renounce each of its other expired salaries to acquire both Davis and top free agents. If the Lakers are splitting up their cap space into multiple players, they may be able to retain Reggie Bullock's $4.8 million cap hold in order to pay him an even larger deal if needed.

The free-agent pool is deep, especially at center where the Lakers could go after Al Horford (with most of their cap space), DeAndre Jordan, Nikola Vucevic, Jonas Valanciunas, JaVale McGee, either Brook or Robin Lopez, Dewayne Dedmon, Boban Marjanovic, Enes Kanter, Nerlens Noel, Joakim Noah or Tyson Chandler.

At other positions, they could chase Ricky Rubio, Darren Collison, Cory Joseph, Derrick Rose, Kentavious Caldwell-Pope, Wayne Ellington, Terrence Ross, Danny Green, Trevor Ariza, Lance Stephenson, Seth Curry, JJ Redick, Kyle Korver (if released by the Memphis Grizzlies), JR Smith (if let go of by the Cleveland Cavaliers) and Bojan Bogdanovic, to name a few.

A roster with a strong offense-defense pairing with Russell and Beverley in the backcourt, with Beverley providing a physical toughness the team will need throughout the season and playoffs. Add in an underrated big man like Dedmon, along with experienced veterans, shooters and defenders and the Lakers will have the depth necessary to compete.

Most will be expensive, and some will be out of reach entirely if the Lakers invest in a max free agent. But general manager Rob Pelinka gained significant flexibility by expanding the deal for Davis with the Wizards.

Whether he had a plan from the start or adjusted along the way, we don't know. But giving him the benefit of the doubt was always reasonable, and it's why a run at Leonard should be taken seriously.

Free agency begins June 30. Teams can start signing and trading players on July 6. Get ready.

Email Eric Pincus at eric.pincus@gmail.comn Twitter @EricPincus.