After being left for dead following a brutal start to the season, the Dallas Mavericks are playing good basketball again. Dallas has gone 8–3 in its past 11 games, including a back-to-back sweep of the Spurs and the Cavs. It was the Mavs’ first win in San Antonio in seven years, and their first win over LeBron James since the 2011 Finals. A team that was playing for ping-pong balls a month ago is suddenly alive in the playoff race, only 2.5 games out of the no. 8 seed out West.

The Mavs’ sudden turnaround is all thanks to a lineup change they made before their January 12 game against the Suns in Mexico City. After experimenting with a number of different lineups over the previous few months due to injury and ineffectiveness, Rick Carlisle went all in on small ball, starting Dirk Nowitzki at center next to Harrison Barnes, Wesley Matthews, Seth Curry, and Deron Williams. The Mavs came into the season expecting to start Andrew Bogut at center with their other four veteran mainstays, but that group was too flat-footed to keep up with opposing teams in a smaller and faster NBA. Their original starting lineup wasn’t able to threaten defenses with much playmaking off the dribble, either. In 43 minutes together this season, they have a net rating of minus-40.2.

In the 11 games since the Mavs made the switch, including a loss to the Thunder in which Dirk sat out, the team has an offensive rating of 111.5, which would have them tied for third in the NBA for the entire season. Considering their personnel, the company they are keeping is amazing. The top-three offenses in the league are all powered by multiple elite guards — Steph Curry and Klay Thompson for Golden State, Kyle Lowry and DeMar DeRozan for Toronto, James Harden and Eric Gordon for Houston. The Mavs’ starting guards are Williams, a shadow of his former self, and the younger Curry, on his fifth team in four seasons. With Williams out the past three games, they have plugged in Yogi Ferrell, an undrafted free agent whom they signed to a 10-day contract on Saturday, without missing a beat. If the best offenses are powered by strong guard play, how are the Mavs succeeding with two recent D-Leaguers in their starting backcourt?

“It’s obvious what makes them tough to guard,” said 76ers coach Brett Brown before their game against the Mavs on Wednesday. “The fact that Dirk can pick-and-pop and shoot 3s at an elite percentage. There are 5s who can shoot 3s, but he’s a 4 who can really shoot and is now playing at the 5. It’s an unusual sort of position that when people can do that it causes tremendous defensive problems.”

This version of the Mavs shoots 3s as well as any team. Every player in their starting five has to be guarded 25-plus feet from the basket, putting the defense in an almost impossible position.

No player has benefited more than Curry, who is starting to make his own name in the NBA. He’s averaging 15.8 points on 50.4 percent shooting in the past 11 games, including an eye-popping 47.5 percent from 3. He’s shooting about as well as his brother, in part because he’s one of the only guards in the NBA playing in more space than Steph. Just look at this sequence against the Spurs where Curry makes a game-sealing basket with less than 17 seconds left. Once he runs a pick-and-roll with Nowitzki, there’s no second defender to help when he beats his man off the dribble. He’s playing against the second-rated defense in the NBA on its home court, and he might as well be shooting a layup in the park on a lazy Sunday afternoon.

“First of all it’s a lot of space out there. We’ve got a lot of shooters out there who can knock down shots,” Curry said in a radio interview on Tuesday. “We’ve got multiple playmakers with myself and Yogi, or when Deron’s in the lineup, whatever the case may be — a couple guys who can make plays with the ball, get in the lane. Obviously Dirk and [Barnes] draw a lot of attention, so that’s good for us with getting open looks.”

In a league where point guard play is more important than ever, it hasn’t mattered that much who has been running point for the Mavs. In the 98 minutes when Williams has played with Curry, Matthews, Barnes, and Nowitzki this season, the Mavs have an offensive rating of 111.8. In the 44 minutes when Ferrell has played for Williams, they have an offensive rating of 107.7. That’s the power that floor spacing can provide.

Ferrell had a 10-game stint with the Nets earlier in the season, and his play with the Mavs is the closest thing to a controlled experiment that you will see in the NBA. If you prorate his playing time over 36 minutes, he’s the same player he was in Brooklyn, except he’s doing a much better job of taking care of the basketball.

“Playing with Dirk definitely helps a lot, especially for me. I can use my quickness to come off the ball screen,” Ferrell said Wednesday. “If I got a layup, I’ll take it. If they stay with me, you got Dirk at the top of the key where he can get into his iso. That’s what [Carlisle] wants me to do. Attack, go downhill, make the right pass, knock down the right shot.”

It’s a lot easier to read the floor when the defense is spread this far out. The game becomes very simple.

Of course, the flip side of playing Nowitzki at center is what it does to the defense. He was never the most mobile big man to begin with, and now, at the age of 38, he moves like his feet are encased in carbonite. At 7 feet and 245 pounds, he has the size to hold his own as a post defender, but there’s not much he can do when it comes to protecting the rim or guarding in the pick-and-roll. The Mavs’ strategy against the two-man game is to plant Nowitzki in the paint and pray the opposing guard misses the open jumper. If an opposing player gets a lane to the basket, the best Nowitzki can hope to accomplish is stand in place and avoid the foul. Despite playing so close to the basket on defense, he averages only 5.9 rebounds and 0.8 blocks a game.

When I asked Carlisle about how they could defend better with Nowitzki at the 5, he essentially conceded defeat on that side of the ball: “A lot of it comes down to offense. Execute well and get good shots and you can position yourself to get back and guard more effectively than if you have turnovers,” he said. “We have to play an efficient game. We have to be tied together. The ball has to move. Once we get a shot, we have to get back.”

There’s a feedback effect in basketball. Great offense leads to good defense because the other team is always inbounding the ball from under its own basket, allowing the defense to get set. Over at Nylon Calculus, Seth Partnow ran the numbers for the 2014–15 season and found that teams’ effective field goal percentage was 6.3 points higher off a live ball — when the defense is scrambling to get back in transition — than a dead ball. The Mavs have been living in that feedback effect, allowing 102 points per 100 possessions in the past 11 games. The Rockets have seen similar results this season. For as much as people worried about their defense, they have been so good on offense (no. 3) that it has lifted them to league-average defensive efficiency (no. 17).

For the Mavs, at least, the question is how sustainable that level of defense is over the course of the season. As opposing teams gather more film on them with Dirk at the 5, they will undoubtedly run more sets designed to punish him in the pick-and-roll. That would go double if Dallas were to make it to the playoffs, when opposing teams change their entire offensive game plan to attack weaknesses in the other team’s defense. The Rockets ran the Mavs off the floor in the 2015 playoffs by attacking Dirk in space, and it’s hard to see lineups with him as the primary rim protector being very effective against some of the best offenses in the NBA in a seven-game series.

Nevertheless, for the Mavs to even be thinking about the playoffs is a miracle considering how poorly they started the season. They were one of the worst teams in the league until they found a cheat code that turned their offense into a low-rent version of the Warriors. Dirk Nowitzki’s ability to shoot 3s from the power forward position helped changed the NBA. For his last act in the league, he’s trying to do something similar at center.