*** Welcome to piglix ***

The Magician's Code

"The Magician's Code"
How I Met Your Mother episode
Episode no. Season 7
Episode 23 (Part 1)
Episode 24 (Part 2)
Directed by Pamela Fryman
Written by Jennifer Hendriks (part 1)
Carter Bays & Craig Thomas (part 2)
Original air date May 14, 2012 (2012-05-14)
Guest appearance(s)

Lyndsy Fonseca (Daughter)
David Henrie (Son)
Chris Elliott (Mickey Aldrin)
Becki Newton (Quinn)
Ashley Williams (Victoria)
Vicki Lewis (Dr. Sonya)
Rob Huebel (Mr. Flanagan)

Episode chronology
← Previous
"Good Crazy"
Next →
"Farhampton"

Lyndsy Fonseca (Daughter)
David Henrie (Son)
Chris Elliott (Mickey Aldrin)
Becki Newton (Quinn)
Ashley Williams (Victoria)
Vicki Lewis (Dr. Sonya)
Rob Huebel (Mr. Flanagan)

"The Magician's Code" is the hour-long final episode of the seventh season of the CBS sitcom How I Met Your Mother. It aired in two half-hour parts on May 14, 2012.

Lily starts going into labor, but refuses to go to the hospital until Marshall is there with her. Ted and Robin try to distract her with stories from their past until her contractions are four minutes apart, and Lily finally agrees to go to the hospital.

Meanwhile, Barney and Marshall are stuck in Atlantic City following the events of "Good Crazy" and must find a way back to Manhattan for the birth. Barney offers to help Marshall on the condition that Marshall's son has the middle name "Wait-for-It". Marshall agrees and Barney manages to secure two seats on a bus to New York — only for Marshall to realize that the destination refers to the state of New York and not New York City; its final destination is actually Buffalo. The two are left trying to find another way back to the city when several senior citizens on the bus, inspired by Marshall's predicament, claim to be having heart attacks to force the driver to take a detour to the hospital where Lily is giving birth.

Lily starts giving birth without Marshall, and Robin faints at the sight of the birth. Marshall arrives just in time for his son to be born, whom Lily names after Marshall's late father and honors Barney's condition, and everyone welcomes Marvin Wait-for-It Eriksen into the world.


...
Wikipedia

...