On October 22, 2011, the Chicago Cubs announced the hiring of Theo Epstein as president of baseball operations. Epstein, only 37 years old at the time, was already considered one of the greatest baseball executives in recent history and a potential future Hall of Famer. Five days later, the Cubs hired away Jed Hoyer and Jason McLeod from San Diego as Epstein’s top lieutenants.

They would inherit a team that famously hadn’t won the pennant since 1945 and the World Series since 1908. The organization was also coming off consecutive last-place finishes, with a weak crop of young talent. Sure, there were some prospects in development at the low levels—most notably Javier Baez and Willson Contreras—but the highest-ranked prospect Epstein, Hoyer, and McLeod inherited was Brett Jackson, in mid-bust.

In their first offseason, the new Cubs braintrust did surprisingly little of note, spurning a rich free-agent class. They made one key move, trading oft-injured young pitcher Andrew Cashner to San Diego for first base prospect Anthony Rizzo, marking the third time a front office with Hoyer and McLeod had acquired Rizzo. As former BP editor-in-chief Sam Miller recently brought up at ESPN, this trade was not precisely a clear win for the Cubs for a few years, as Cashner looked like he might be developing into a top-of-the-rotation arm and Rizzo threatened to stall out as a good but not great player. Eventually, Cashner stopped being healthy and Rizzo started being a superstar, and the Cubs had their first building block young hitter.

The 2012 Cubs were even worse than the 2010 and 2011 Cubs, finishing with the second-worst record in baseball. This was by design; this rebuild was going to take a little time. But they did get a nice gift: the best half-season of Ryan Dempster’s career, right as Dempster’s contract was expiring. The Cubs wisely flipped Dempster in July to the Texas Rangers for a package led by infield prospect Christian Villanueva. The second player in the deal was an unheralded command-and-control righty pitching well in High-A named Kyle Hendricks. BP's own Kevin Goldstein noted the upper minors would be a challenge for Hendricks due to an arsenal of pitches topping out as average or worse. They weren’t, and the majors haven’t been either for the 2016 MLB ERA champion.

The second-worst record in baseball gets you the second overall pick in the following year’s MLB draft. Three players—Mark Appel, Jonathan Gray, and Kris Bryant—were viewed as above the pack and the likely top three picks. The Astros took Appel, since traded to Philadelphia and possibly never to make the majors. The Cubs pounced on Bryant, the 2015 National League Rookie of the Year and likely 2016 Most Valuable Player, one of baseball’s handful of biggest superstars only two years into his career.

The 2013 Cubs were nearly as bad as the 2012 Cubs. Like the 2012 team, they got an unexpectedly strong half-season out of pitcher Scott Feldman, entering the final year of his contract. At the deadline, Feldman was moved with backup catcher Steve Clevenger for two project pitchers. Pedro Strop had shown flashes of putting things together, but pitched to an ERA over 7.00 in the first half of 2013. Since the Cubs acquired him, he’s been a valuable setup man.

The second pitcher, Jake Arrieta, was a golden-armed former top-100 prospect in his fourth year of inexplicable mediocrity at the major-league level. Cubs pitching coach Chris Bosio rebuilt Arrieta’s mechanics. Arrieta won the 2015 National League Cy Young award, and is now firmly entrenched as one of baseball’s top pitchers.

The Cubs still didn’t make any big-money free agent moves going into 2014. They did sign veteran pitcher Jason Hammel to a one-year deal, and like Dempster and Feldman, Hammel threw his best baseball for a half-season. This time, Epstein and the Cubs went for a bigger fish in the trade pool, attaching Hammel to their best trade piece, emerging star pitcher Jeff Samardzija.

The Epstein regime had inherited Samardzija as a tantalizing physical talent just starting to put it together in relief, and nurtured him into a high-end starter. By packaging together a year-and-a-half of Samardzija and a half-season of Hammel, the Cubs were able to pry top-10 global prospect Addison Russell away from Oakland. Russell made the majors early in 2015, and was an All-Star in 2016 at only 22.

After the 2014 season, the Dodgers hired away Tampa Bay’s answer to Epstein, Andrew Friedman. Friedman’s departure invoked an out clause in well-regarded manager Joe Maddon’s contract. The Cubs quickly pounced on Maddon, making him one of the highest-paid managers in baseball. We have no real way to measure Maddon’s impact on the Cubs—his strategic decisions seem fine, but not particularly noteworthy—but he gets incredible marks on “soft factors” that we cannot yet measure from most in baseball.

With Maddon on board and a young core, the Cubs finally opened up the pocket book for the 2015 season. Free agency that offseason contained two aces, Jon Lester and Max Scherzer. Epstein reeled in one of the big fish in Lester with a six year, $155 million deal, recounted memorably in Jeff Passan’s The Arm. Infielder Luis Valbuena was dealt for rental outfielder Dexter Fowler, which not coincidentally also opened up a spot for Bryant. The Cubs brought Hammel back on a two-year deal, completing the circle, and he’d provide valuable innings in the middle of the rotation. They would win 97 games before ultimately bowing out in the NLCS.

Expectations for the 2016 Cubs couldn’t have been higher. Epstein and friends were very aggressive in free agency, first coming out of nowhere to snag Ben Zobrist–baseball’s version of a Swiss Army knife–and then signing top outfielder Jason Heyward to a mega-deal, and finally bringing back Fowler on a surprisingly team-friendly one-year deal. They’ve had a few bad breaks—Heyward couldn’t have been worse in his first year in Chicago, and slugger Kyle Schwarber blew his knee out in the first week of the season—but they still won 103 games, running away with the NL Central.

Baez and Contreras emerged after years in the minors as budding young stars, to add to the Epstein-acquired core. The braintrust even made a strong buy midseason for a change, dealing top prospect Gleyber Torres and others for elite closer Aroldis Chapman, though Chapman came with a dark cloud of domestic violence allegations attached.

On October 22, 2016, the Cubs won the pennant. Kyle Hendricks out-pitched the ace of the universe, Clayton Kershaw. Kris Bryant and Dexter Fowler had RBI singles. Willson Contreras and Anthony Rizzo hit impressive home runs off a fading Kershaw. Aroldis Chapman pitched the last inning-and-two-thirds to close it out.

It took Theo Epstein exactly five years—and quite a few shrewd moves—to get the Cubs into the World Series.