An x-ray reveals that Homer has a crayon lodged in his brain that has been there since he was six years old. Upon removal of the crayon, Homer's IQ suddenly jumps to a very high level; he and Lisa form a great new bond, but when his way of life changes drastically he wonders if removing the crayon was a good idea. This episode is a take on the short story turned novel, Flowers for Algernon by Daniel Keyes, about a mentally challenged man who becomes a genius after an experimental procedure, only to end up alienating those around him.
The next day at work, Homer checks his stocks, the operator tells him that Animotion's stock is up by one. Homer shouts, "Yahoo!" and the operator tells him that Yahoo!'s stocks are up by six. Homer says,"Huh? What the hell is this crap?" He is then sold the FOX network's stocks.
The next day, Homer learns that the Animotion has gone into "super-duper" bankruptcy. To earn the family's life savings money back, Homer takes a job at a medical testing center. During one experiment, the doctors find a crayon lodged in Homer's brain from when he was a child, which has been the cause of his lifelong stupidity.
After the crayon is removed, Homer's IQ goes up from 55 to 105 points, which allows him to form a bond with Lisa. Homer gives a speech at Springfield Elementary, where Nelson gives him a fake question, saying,"A-moron-says-what?" Homer responds with, "Not being a moron, I wouldn't know. However, [mumbles]" tricking Nelson into saying "what?" Homer says, "Ladies and gentlemen, I give you your moron!" And all the children 'ha-ha!' Nelson.
Homer later visits Ned and shows him that while doing his taxes he inadvertently came up with a formula that proves that there is no God. Ned scoffs until he reads it and dejectedly finds that its air tight. He quickly burns it to prevent the information from getting out only to see Homer pinning it to car windshields and people already reading it.
Homer then writes a report on the nuclear plant's safety, which results in the plant being shut down, and the laying off of all employees. Homer's friends, initially thrilled to have a smarter Homer around, quickly reject him, and a Homer model is even burned at Moe's Tavern, which he is not allowed in. Lisa tries to explain, with the aid of a graph, that as you get smarter, happiness decreases. Homer decides to put a crayon back in his brain, with the aid of Moe, who says he is an unlicensed surgeon, and describes the procedure as "the old Crayola oblongata". Homer arrives home his old, dumb, self, which initially disappoints Lisa. However, she finds a letter Homer wrote to her before the surgery, explaining that he now understands what it is like to be smart like her, and how much more he appreciates her because of this. When Homer comes into the living room eating a sandwich, Lisa runs up to hug him. Homer mistakes her for wanting his sandwich and pulls away, then saying, "Oh, you want a hug." As they hug, Homer takes another bite of his sandwich and says, "Mmm... hug."