1 of 2
Jae C. Hong, Associated Press
Joe Maloof, left, and his brother Gavin

The Dallas Mavericks knew they could trade Jerry Stackhouse for a key player for next season. As it turned out, a lot of teams benefited.

The Mavericks, Raptors, Grizzlies and Magic combined in a massive swap Thursday that included eight players, a draft pick and stacks of cash. The deal sent Shawn Marion to Dallas, Stackhouse to Memphis and helped seal the transaction that moved Hedo Turkoglu from Orlando to Toronto.

Among the other pieces: Forward Kris Humphries and center Nathan Jawai went from Toronto to Dallas; guard Greg Buckner moves from Memphis to Dallas; and swingmen Antoine Wright and Devean George go from Dallas to Toronto.

Memphis also received a second-round pick and cash from Toronto, while Orlando got cash from Dallas and the Raptors.

The Magic were going to lose Turkoglu anyway. After Orlando acquired Vince Carter, Turkoglu opted out of his contract and became a free agent. He'd already decided to go to Toronto, but turning his departure into a sign-and-trade helped glue together the rest of this complex puzzle.

The Mavs are no strangers to convoluted, multi-team deals, but this one was still taxing. Team owner Mark Cuban posted on his Twitter feed late Wednesday: "It's been a long day of looking at spreadsheets, reading NBA cap rules and rubbing my eyes."

It was worth the effort to Cuban because Dallas got Marion, a four-time All-Star nicknamed "The Matrix" because of his do-it-all game. The Mavs are hoping he'll be a great complement to a starting lineup featuring Dirk Nowitzki, Jason Kidd and Josh Howard.

Marion was a matchup nightmare during his heyday with the Suns — too big for Howard, too quick for Nowitzki. For his career, he's averaged 17.8 points, 9.9 rebounds, 2.0 assists, 1.83 steals and 1.31 blocks per game.

But Marion is also 31 and headed to his fourth team since February 2008, having bounced from Phoenix to Miami to Toronto. He's also coming off a season in which he had his fewest points, rebounds, blocks and steals since his rookie season.

Stackhouse was enticing because although his contract is for more than $7 million, if he's waived by mid-August he can be bought out for only $2 million. That's likely the amount of cash Memphis received.

Buckner, who has played in Dallas twice before, has a similar contract. He's likely to be dealt again or bought out.

With the deal, the Mavericks are hoping to keep pace with all the roster overhauls in the West.

The Lakers and Spurs — historically, their two biggest rivals — seem to have improved, too, and Cuban knew he needed something big to up. Dallas has won at least 50 games and made the playoffs nine years in a row, but the Mavs don't have a title to show for it.

Kidd already has agreed to re-sign, although the paperwork is pending. Dallas also is expected to get 25-year-old center Marcin Gortat, who was Dwight Howard's backup in Orlando last season. Gortat is in the process of signing an offer sheet that the Magic will have one week to match, although that's believed to be unlikely.

The Mavs also are hoping to keep their own free agents, Brandon Bass and James Singleton.

PISTONS PICK KUESTER AS COACH: In his decade running the Detroit Pistons, Joe Dumars hasn't been known for showing patience with head coaches. He insists that is about to change.

Moments after introducing Cavaliers assistant John Kuester as Detroit's sixth coach in 10 years, Dumars said Thursday that Kuester "might have the most job security of anyone in the NBA."

"Bless you, Joe," said Kuester with a laugh.

Kuester replaces Michael Curry, who was fired on June 30 after going 39-43 in his first season and being swept by Cleveland in the first round of the playoffs. Detroit had reached the Eastern Conference finals in the previous six seasons under Rick Carlisle, Larry Brown and Flip Saunders.

Detroit has almost completely turned over that roster, with only Richard Hamilton and Tayshaun Prince remaining from the 2003-04 championship team. They added Charlie Villanueva and Ben Gordon in the first hours of free agency.

"For the last seven years, the criteria for success here has been making the finals," said Dumars, the team's president of basketball operations. "That's not the gun that will be held to John's head. Right now, we're looking to move this franchise back in the right direction."

When Dumars fired Curry, he said he wanted a coach with more experience and there was speculation that veterans like Doug Collins or Avery Johnson would take the reins. Neither situation came together, though Dumars did talk with Johnson about the job.

CAVS SIGN VAREJAO: The Cleveland Cavaliers and Anderson Varejao — the energetic big man with curly hair known to fans as "Wild Thing" — have agreed on a multiyear contract.

Cavaliers general manager Danny Ferry announced the signing Thursday afternoon, though terms were not disclosed. The 6-11 center forward from Brazil has played five years in the NBA, all with the Cavaliers.

The deal was first reported by The Plain Dealer late Wednesday. Agent Dan Fegan told the newspaper that the club and Varejao agreed on a six-year contract worth up to $50 million. Fegan did not return messages Thursday from The Associated Press.

CLIPS INK GRIFFIN: The Clippers have signed Blake Griffin, the No. 1 overall pick in the NBA draft. The team says Thursday that Griffin's deal was official, and terms were not announced.