All 43 episodes were written by Steven Moffat. During production of series two, he was having an unhappy personal life after the break-up of his first marriage. His wife's new lover was represented in the episode "The Big Finish?" by the character Brian Magboy (Simon Schatzberger), a name inspired by Brian: Maggie's boy. Moffat brought in the character so that all sorts of unfortunate things would happen to him, such as having a typewriter dropped on his foot. This period in Moffat's life would also be reflected in his sitcom "Joking Apart".