After five seasons, Dr. Max Goodwin’s tenure at New Amsterdam has come to an end.
The NBC medical drama—which aired its series finale on Jan. 17—concluded with a tear-jerking twist after Ryan Eggold‘s Max left his position as medical director to work at the World Health Organization in Geneva.
The episode sporadically introduced Max’s unnamed replacement leading up to his last day in the hospital, but it wasn’t until the final scene that it was revealed that the woman taking over his position was actually his now-adult daughter, Luna, in the future. Now, New Amsterdam executive producers David Schulner and Peter Horton are breaking down the final episode and revealing the surprising source of inspiration for the climactic ending.
“My 11-year-old daughter [Ella] came up with the finale of Luna being the medical director,” Schulner exclusively told E! News during a joint interview with Horton. “I was like, ‘Okay 11-year-old daughter, you eat your Cheerios and I’ll do the writing, thank you very much.’ Then Laura Valdivia—one of our writers—said, ‘Am I crazy, but I think Luna should be the medical director at the end?'”