Time is running out as BOSS prepares to launch its plan for world domination.
Sergeant Benton brings an empty maggot chrysalis to the Nuthatch, revealing that the maggots are about to change into something else. The Doctor discovers that another maggot had died after eating Cliff’s fungus, meaning that it is deadly to them. The Doctor and Benton drive around the slag heaps and the mine, liberally scattering the fungus which kills all the maggots, and disposing of a deadly giant fly which attacks them. Returning to the Nuthatch, the Doctor discovers Cliff’s cure, and uses it to restore him to full health. The Doctor then returns to Global Chemicals to confront BOSS. The computer plans to link up with others and effect a corporate takeover of the human race. However, Stevens, whose conditioning is partially broken by the Doctor using the crystal, tells him to get out while he triggers an explosion which destroys himself, the computer, and the company headquarters.
The menace defeated, UNIT troops and environmentalists gather at the Nuthutch for a celebration made all the more special when Jo and Cliff announce they are getting married and then plan to travel the Amazon looking for a rare fungus, and that the United Nations (after Jo contacted her uncle) have decided to fund Wholeweal’s research: jobs will return to Llanfairfach after all. The Doctor offers his blessing to the couple and gives Jo the blue crystal as a present asking them to save him some wedding cake. However, as the party starts to get into full swing the Doctor quietly slips away, noticed only by Jo who understands why. The Doctor, upset by the departure of his good friend, gets into Bessie and after one final look back at the cottage, sadly drives away.