Alex Rodriguez was baseball's most hated player for a long time. Cut to today, just a year and a half post-retirement from MLB, and Rodriguez has become a fun, welcome personality in the baseball world—and beyond. As he makes his debut as Aaron Boone’s replacement on ESPN’s Sunday Night Baseball this weekend, you might be asking yourself: How, exactly, did we get here?

From almost the beginning, A-Rod's story played against type. He was a 14-time All-Star, three-time AL MVP, two-time Gold Glove winner, ten-time Silver Slugger, five-time AL home-run leader, and two-time MLB RBI leader. He was a young, good-looking phenom who was a great hitter and an impressive middle infielder. He should have been easy to like. He could have melted hearts with his smile and endeared himself to fans simply by performing the way he was capable of. And yet, he was a villain. The guy who, on paper, should have been charismatic and popular was anything but in real life.

There was the on-field behavior that Toronto Blue Jays manager John Gibbons once referred to as “bush league”: yelling “Ha!” while running from second to third base on a pop-up to try to make a Blue Jays player think his teammate was calling for the ball, slapping the ball away to deflect a tag during the 2004 American League Championship Series against the Red Sox. Then there was the off-field behavior that painted him as someone who was a little too in love with himself: He was rumored to have multiple paintings of himself as a centaur, including one that hung above his bed; he agreed to a photo shoot with Details in which he kissed a reflection of himself. And, of course, the PEDs.

But here’s where the A-Rod story take an even stranger turn: Through a genius social media presence and a willingness to embrace the more unsavory aspects of his past, A-Rod has been able to change the narrative. Giving someone perceived as a narcissist a social media account has the potential to backfire spectacularly. The medium, with its capacity for endlessly posting selfies, is designed to keep the focus on the user. And Rodriguez’s account may have gone that route if not for the scandal that would derail his career and, according to him, change his life and perspective on everything.

Rodriguez launched his Instagram account back in May 2013 with a photo of him hitting balls off a tee in the batting cages. He started slowly: Everything he uploaded showed him working out and training as he was making a comeback from a hip surgery and quadriceps strain he suffered earlier that year. Rumors about performance-enhancing drugs were swirling around him, and that August, Rodriguez was one of 13 players suspended for using PEDs. A-Rod's suspension would last for the entire 2014 season, the longest non-lifetime suspension ever given.

He told Vanity Fair last year that he decided to try to make the team in 2015 “as a broken-down 40-year-old that didn’t have a lot of allies.” His public image was forever changed by the steroid scandal but, once again going against the grain, Rodriguez found himself cheered at Yankee Stadium after being officially labeled a cheater. A bounce-back season where he slugged 33 home runs and had an OPS+ of 129 surely helped, not to mention a public growing increasingly weary of MLB’s steroid witch hunt.

It was in the lead up to his (forced) retirement in 2016, however, that social media really began to work its magic. Alex the Ballplayer slowly became Alex the Entrepreneur, and his account was full of pictures of Rodriguez hard at work—either in a suit for A-Rod Corp., or in Yankees pinstripes on the field. He also began to look like he was capable of having fun and is genuinely laughing in many of the images.

Post-retirement, working as a FOX Sports analyst during the playoffs, he looks fully in his element. He’s working a camera, he’s putting makeup on co-anchor Kevin Burkhart, he’s taking selfies at Wrigley Field. What comes through more than anything in these photos is joy, something that was often missing from him as an active player, and it resonated with the public.

Enter J.Lo, the final piece of A-Rod’s three-part formula for social-media success. She makes her first appearance on Rodriguez’s Insta account when the two attended last year's Met Gala together. The best photo from the night was one of Rodriguez, standing off to the side, cellphone raised to snap photos of Lopez on the red carpet. He’s happy to let Lopez have the spotlight—the opposite of the narcissistic center of attention he was known for being in the Yankees clubhouse.

These early glimpses of the couple that would come to be known as J-Rod did something that neither celeb could have done on his or her own. They painted them as a couple enamored with each other, who were easy to root for. This characterization of the partnership has been especially significant for Rodriguez. He spent his 22-year major league career struggling to connect with the public. And despite the fact that he is inarguably one of the best baseball players to have ever played the game, he was always difficult for people to really root for, something that’s usually a requirement for a sports superstar. It was his perceived arrogance and standoffishness that kept a wall up between A-Rod and the public.

In retirement, perhaps the pressure to prove himself and gain acceptance is gone. Perhaps, as he settles into his new role as an entrepreneur, baseball analyst, media personality, and one half of a high-profile celebrity couple, he’s content to just be who he is and be where he is. It’s impossible to know for sure. But what is evident is that, over the course of a few short years, Rodriguez went from almost universally despised to near universally adored. It’s a redemption story that wouldn’t have been possible in an age before social media.

By embracing his past, redemption has become part of his image; it’s now his brand. At SXSW, he hosted a panel called “Baseball, Business, and Redemption.” His new show on CNBC, Back in the Game, is about helping former pro athletes get back on solid footing after a setback. Instead of trying to bury the embarrassing and unflattering parts of his past, he’s using them to create a new image of himself, and educate others.

The story of the underdog is the most compelling sports narrative we have. Perhaps that was always Rodriguez’s problem: He was too golden, too hard to root for because it seemed like there was no struggle before the triumph. Maybe it became possible to root for A-Rod only after he flew too close to the sun.