Steven Moffat "wrote and rewrote" the final 'Doctor Who' episode featuring Amy Pond and Rory Williams' exit.
The show chief had a lot of trouble getting to grips with how the characters - played by Karen Gillan and Arthur Darvill - would leave the series in last episode 'The Angels Take Manhattan', until eventually deciding just before he had to hand it in.
He said: "How and why should they leave? And would they live or die? I wrote and rewrote. I had a completely different endings and threw them away. I locked myself away in my house in Cardiff, drank more coffee than should be legal and got it wrong, time after time.
"It's a funny thing about stories. It doesn't feel like you make them up, more like you find them.
"So many times over those mad few days, the fate of the Ponds changed. Alive, dread, alive, dead. Everything was wrong, nothing felt right. And then, about 4am - with the gaspingly last script promised to the production team in a few hours - I remembered 'The Eleventh Hour', the first episode featuring the Ponds and the single moment we've been heading for, since the very beginning. Ah well! Fates decided."
However, one thing Steven did not have a problem with was deciding to set their final trip in the TARDIS in New York City.
The writer insists there is no better setting for aliens the Weeping Angels to battle the Doctor (Matt Smith) and his companions than 'The Big Apple'.
He added to Radio Times magazine: "Decision one was easy - it would happen right here in New York - the Ponds would go to their final rest in the city that never sleeps. One of my favourite places in the world was somehow the right place to end it all."