Rick gives Jerry a device to train their dog, Snuffles. He and Morty then go into the dreams of Morty's math teacher to persuade him to give Morty good grades. They go from Morty's math teacher's dreams to Mrs. Pancake's dreams, to a centaur's dreams, and so on. This results in Morty finally getting good grades and Rick and Morty befriending Scary Terry (a parody of Freddy Krueger). Meanwhile, Snuffles builds an advanced mechanical suit and uses a translator to speak to humans. He and his robot dog army proceed to take over the human race, but are eventually convinced to go in another dimension and live their lives there instead.