Erica Buddington came up with a brilliant way to teach her scholars geography.

An educator’s lesson has gone viral for using Cardi B’s “Bodak Yellow” to prepare her class for their geography test.

Erica Buddington, who teaches sixth grade at Capital Preparatory School in Harlem, shared a Twitter video Friday of her rapping a map-inspired version of the hit song to her class. Her students danced in their seats and beat on their desks as Buddington spit her map rap.

“We’ll turn up the temperature, like we’re in Africa/Honestly, pardon me, I’ll give you the data/It’s second to the Earth’s biggest continent: it’s Asia,” she rapped.

Buddington told HuffPost that she wrote a map version of the song after noticing how much kids in her class loved “Bodak Yellow.”

“Students were tapping the song on the desk and yelling out quotes from it,” she said. “They already knew the song, so I revamped it so they could retain continents, oceans and hemispheres.”

Buddington said she was surprised at how hype her geographical remix got the children, but even more surprised that the video went viral. As of Wednesday, her tweet has nearly 52,000 retweets and more than 109,000 likes.

“I was shocked that it went viral. I put it up before I went to sleep to get a few educator reactions, from folks that follow me, and woke up to it being viral,” she said. Buddington’s rap even caught the attention of Cardi, who reposted the video on her Instagram account.

“It’s LIT I LOVE THIS ️BODAK yellow,” Cardi wrote in the caption. “Maaannn I wish my teacher did a educational remix to get your freak on when I was in school Dear Miss teacher ....you need a raise.”

A reward better than viral fame for Buddington and her class, however, is that the rap helped improve their grades. And it only took them a day to learn the hook and verse.

The educator told BuzzFeed that her class showed a 92 percent proficiency on a standard map quiz compared to the previous 60 percent.

She shared the lyrics to her song for other teachers to use in their classrooms.

“The response is overwhelmingly positive, from parents and educators alike,” Buddington told HuffPost. “Using songs to retain information isn’t new, but I think folks were shocked at my flow. I used to be an emcee.”

She also noted on Twitter that students throughout the school were singing her version. Buddington said she plans on incorporating rap into her lesson plans at least once a week.

“I do plan on utilizing more hip-hop,” she said. “It’s a mental break and important device for my students.”

"If you see me with a map, ask me how I get to school." (Courtesy of Buddington)