WARNING: The following contains spoilers for Supergirl Season 6, Episode 11, "Mxy in the Middle," which aired Tuesday on The CW.

Season 6 of Supergirl has been building up the threat of the 5th-Dimensional Imp Princess Nyxlygsptlnz as the final cosmic threat of the series. Picking up right where "Still I Rise" left off, "Mxy in the Middle" starts with the arrival of Mister Mxyzptlk, also known as Mxy, after being summoned by Supergirl. The other 5th Dimensional Imp comes to her aid against the princess, defending Supergirl from Nyxly's blasts. The two manage to escape and regroup with J'onn and the others, minus Kelly who's dealing with the fallout from the building Nyxly destroyed.

Unable to perform magic without Nyxly tracking him, Mxy performs a musical number to the tune of "I Will Survive," with the lyrics swapped for Nyxly's life story. Nyxly and her brother conspired to overthrow their father, the mad King Brpxz, but were caught in the act. The king disowned Nyxly, while her brother received praise for his ferocity. While painting a look at how fictional patriarchies are just as unfair as real ones, this story goes is the opposite of what Nyxly originally told Kara. She stated King Brpxz killed her brother, though Mxy figures she was speaking metaphorically, as Nyxly considers her brother dead to her.

RELATED: Supergirl: CatCo Can't Beat Iris West's Beloved Reporting at The Citizen

supergirl mxy singing to i will survive

The most important part of Mxy's song is about the AllStone, an incredibly powerful object created by an evil Imp named Jyrryd. The AllStone was meant to give the Imp mastery over everything, even life and death. The other 5th-Dimensional Imps were not so keen on his plan, banishing Jyrryd and blowing up the AllStone. The broken pieces became totems. Every planet has a set of them, according to Mxy. Nyxly wants to collect the totems to make a new AllStone, though this is made difficult by the fact that the totems can be disguised as anything. To get around this, she uses a crystal belonging to Jyrryd that can track down the totems, though she needs one final thing to make it work: a descendent of Jyrryd to stick inside the orb. In a somewhat convenient twist, Mxy reveals he is Jyrryd's last descendant, making him Nyxly's target.

Throughout the episode, Nia struggles with the guilt over having been the one to release Nyxly. This guilt is made even worse when Kara begins blaming herself for Nyxly's appearance, as she believes she brought Nyxly into the real world from the Phantom Zone. After confiding in Brainiac 5 and demonstrating how far their relationship has come in terms of trust, Nia also reveals the truth to Supergirl. Expecting to be hated by her hero, Nia is relieved when Kara understands that Nia simply made a mistake, just as they all have in the past.

Examining the blueprints of the device Nyxly used to restore her powers, the Superfriends come up with a plan to use a power-dampening cuff powered by magic to depower Nyxly. Mxy offers an amulet he hid away after Mon-El used it to fight against the Imp. Without being able to use his magic, Mxy finds his aid is all but worthless as the team works on the device. Eventually being summoned downtown to fight against a giant cat Nyxly conjured, the Imp gives the team a time limit of two hours to hand over Mxy. Mxy contributes the idea of cloning himself to trick Mxy, though his clone falls apart quickly. Supergirl and Nia improve on this idea by having Nia take on Mxy's appearance to get close enough to Nyxly to use the cuff on her.

RELATED: Supergirl's Final Season Features a Pivotal Moment for Guardian

supergirl mxy and dreamer

Dreamer uses Brainy's image inducer to replicate Mxy's appearance, and she and Supergirl go to meet Nyxly. Unfortunately, the power-dampening cuff disrupts Dreamer's illusion, leading to Nyxly capturing the Superfriends to draw Mxy in. She summons a Kryptonite-breathing dragon to threaten the team, all while telling them the tale of how Mxy said he would support Nyxly in overthrowing her father, only for Mxy to vouch against her during the trial. Mxy arrives and saves the Superfriends, wanting to make up for his past actions, but gets captured by Nyxly in the process. Though he is sealed in the orb, Mxy manages to get the power-dampening cuff on Nyxly before she beams back to her ship.

The Superfriends regroup and agree to try to save Mxy while stopping Nyxly from recreating the AllStone. Mitch, the alien criminal Nyxly used to help get her powers back, only saved Nyxly so that she could grant him a better life with her powers. Being powerless again, Nyxly agrees to grant his wishes if they succeed in finding the totems, starting with the totem of courage. Nia sees this in her dreams, letting the Superfriends know what Nyxly's next move is. It's not clear yet if the totems are meant to be real people like the Paragons in Crisis were, or if they are simply everyday objects. Either way, the A-plot ends with the stage set for the Superfriends to go after Nyxly and save Mxy.

For the episode's B-plot, Lena is off visiting her mom's hometown. She and Andrea speak on the phone about a photo of Lena's mother Elizabeth, and her two childhood friends. Lena asks Andrea to locate one girl in the photo, Florence, which the CatCo CEO happily agrees to. Lena's arrival in town is less than welcome, with both the bed and breakfast and pub owners throwing her out. The pub owner, named Peggy, is the daughter of Margaret Bishop, the other woman in the photo with Elizabeth and Florence. Peggy reveals to Lena that their mothers were in a coven together and that Elizabeth allegedly killed Margaret.

RELATED: Supergirl's Chyler Leigh Teases a Series Finale That's Full of Bittersweet Tears

supergirl lena with florence

Already burdened by her Luthor side, Lena wants to give up and go home. Andrea calls back with information on Florence and urges Lena to continue pursuing the truth. Arriving at what looks like a little hut in the woods, Lena finds Florence, who reveals that Elizabeth, Margaret and herself were in fact witches, who went after Margaret's husband after learning he was beating her. What was intended as a scare tactic accidentally turned into murder when the three lost control of their magic and set the shed on fire. Florence ends by telling Lena that she inherited her mother's gift, something the scientist finds hard to believe.

In terms of main story, "Mxy in the Middle" does an excellent job setting up for the final stretch by confronting Nia's guilt and focusing mainly on the battle to stop Nyxly. Dreamer's character development is front and center, with her able to interpret her dreams, while maintaining a healthy, honest relationship with Brainy. On the other hand, character storylines like Kelly's and Lena's seem to have gotten lost in the process. Kelly has still not donned the Guardian armor, though the teaser for next week's episode seems to finally mark its debut. With only a few episodes left in the series, it's a shame that Kelly didn't get more time to suit up and show off her skills.

That leads into the other dangling storyline: Lena's magical ability. Lena's journey to find her mother's side of the family felt like a natural progression for someone trying to get away from the insanity of her Luthor heritage. Elizabeth Walsh having a darker past than Lena knew even makes sense, but the sudden revelation that Lena's mother was magical comes a bit too late to do any good. With only a few episodes left and a major threat to resolve, Lena's development as a witch will be short and probably not so sweet for viewers who appreciated Lena as a great human character among superbeings. Lena's magical abilities will likely play a factor in the final battle against Nyxly, leaving it up to fans of Supergirl to decide whether another character becoming a superhuman so close to the end was really necessary.

New episodes of Supergirl air Tuesdays on the CW.

KEEP READING: Why Supergirl Should End without a Romance for Kara