Purpose in the Machine

"Purpose in the Machine" is the second episode of the third season of the American television series Agents of S.H.I.E.L.D. Based on the Marvel Comics organization S.H.I.E.L.D., it follows Phil Coulson and his team of S.H.I.E.L.D. agents as they try to open a Kree portal to another planet. It is set in the Marvel Cinematic Universe (MCU) and acknowledges the franchise's films. The episode was written by DJ Doyle, and directed by Kevin Tancharoen.

Clark Gregg reprises his role as Coulson from the film series, and is joined by series regulars Ming-Na Wen, Brett Dalton, Chloe Bennet, Iain De Caestecker, Elizabeth Henstridge, Nick Blood, Adrianne Palicki, and Henry Simmons. The episode introduces guest star Spencer Treat Clark as Werner von Strucker, whose father appeared prominently in Avengers: Age of Ultron. James Hong also guest stars, and Peter MacNicol returns to the series after making a guest appearance in the first season.

"Purpose in the Machine" originally aired on ABC on October 6, 2015, and according to Nielsen Media Research, was watched by 4.32 million viewers. The episode received a mostly positive response, with Tancharoen's direction, the guest cast, and the script's momentum for a second episode all praised.

Plot
S.H.I.E.L.D. calls in Dr. Andrew Garner to evaluate Joey Gutierrez, a new Inhuman whom Agent Daisy Johnson wishes to add to her potential Secret Warriors team, for which Garner has not yet approved a member other than Johnson. Garner again denies the request, stating that Gutierrez needs time to adjust to his new reality before even being considered for a covert strike force.

Grant Ward, looking to rebuild Hydra, kidnaps the young Alexander Braun, a child of wealth whose ransom could support the now fledgling terrorist organization. While being interrogated by Ward's right-hand man Kebo, Braun fights back rather than submitting, and reveals himself to actually be Werner von Strucker, son of the previous Hydra leader. Ward, already having known this, explains that Strucker has proven his own strength beyond his name, and tasks him with infiltrating Garner's psychology class.

S.H.I.E.L.D. Agent Lance Hunter tracks down Agent Melinda May, who has been on leave from S.H.I.E.L.D. for six months and is looking after her father, who was injured in a car accident. Hunter hopes that May will help him find and kill Ward, and notes that she suspects that Ward was behind her father's accident, but May is hiding from her life at S.H.I.E.L.D. and difficulties in her relationships with Garner and S.H.I.E.L.D. Director Phil Coulson. May is eventually convinced by her father that getting back into her S.H.I.E.L.D. life by going with Hunter is the best thing for her, and the two leave to infiltrate the new ranks of Hydra.

Agent Leo Fitz, who has been searching for his partner Jemma Simmons since she was apparently consumed by a Kree Monolith, realizes that the stone is a portal. S.H.I.E.L.D. enlists Asgardian Elliot Randolph, who had investigated the portal centuries earlier when it was used by some English Lords for ritualistic sacrifices. Randolph takes them to the ancient English castle of the lords, where a machine was constructed to open the Monolith using vibrations. When the machine falls apart due to age, Johnson uses her Inhuman abilities to replicate its vibrations, despite the portal causing her physical harm. Fitz enters the portal and finds Simmons on a barren planet, bringing her back as Johnson's power destroys the Monolith. Later, Simmons takes comfort with Fitz after a nightmare of her time on that planet.

Development and writing
In September 2015, Marvel announced that it would be titled "Purpose in the Machine", to be written by DJ Doyle, with Kevin Tancharoen directing. Executive producer Jeffrey Bell talked about the opening sequence, featuring 19th Century England, saying "what we're trying to suggest is, whether it's S.H.I.E.L.D. or not, people have been interested in this monolith at least back that far...clearly it's something ancient". He continued saying "One of the things that the movies and we try to do is find scientific ways, or what was once viewed as myth has become grounded more in science, and the ideas that what was ritualistic in the 1800s has become more of a scientific enquiry now with S.H.I.E.L.D."

Casting
In September 2015, Marvel revealed that main cast members Clark Gregg, Ming-Na Wen, Brett Dalton, Chloe Bennet, Iain De Caestecker, Elizabeth Henstridge, Nick Blood, Adrianne Palicki, Henry Simmons, and Luke Mitchell would star as Phil Coulson, Melinda May, Grant Ward, Daisy Johnson, Leo Fitz, Jemma Simmons, Lance Hunter, Bobbi Morse, Alphonso "Mack" Mackenzie, and Lincoln Campbell, respectively. It was also revealed that the guest cast for the episode would include Blair Underwood as Dr. Andrew Garner, Peter MacNicol as Professor Elliot Randolph, Daz Crawford as Kebo, Spencer Treat Clark as Alexander Braun / Werner von Strucker, Alex Hyde-White as Lord Thornally, Daniel J. Wolfe as Lord Manzini, Piers Stubbs as younger lord, James Hong as William May and Darius Cottrell as Moe. Crawford, Wolfe, Stubs, and Cottrell did not receive guest star credit in the episode. Underwood, MacNicol, and Crawford reprise their roles from earlier in the series. Despite being credited, Mitchell did not ultimately appear. Clark is revealed to be playing Werner von Strucker, the son of Baron Wolfgang von Strucker who appeared in Avengers: Age of Ultron portrayed by Thomas Kretschmann.

Filming
Production on the second episode of the season had begun by August 2015. The stunt team, led by second unit director Garry A. Brown and stunt coordinator Tanner Gill, along with Tancharoen, had only around a day to plan Ward's entrance in the episode, involving him driving through a warehouse between pillars while giving a "dissertation" on the future of Hydra. Brown had seen the location during the production of the second season, and had asked that it be used given that building was up for demolition. It was subsequently written into the script for "Purpose in the Machine". The pillars were only about 18 feet apart, and unlike on a film the stunt driver Greg Tracy did not have much time to practice the sequence and work out the best way to do it.

Broadcast
"Purpose in the Machine" was first aired in the United States on ABC on October 6, 2015.

Ratings
In the United States the episode received a 1.6/5 percent share among adults between the ages of 18 and 49, meaning that it was seen by 1.6 percent of all households, and 5 percent of all of those watching television at the time of the broadcast. It was watched by 4.32 million viewers.

Critical response
Eric Goldman of IGN scored "Purpose in the Machine" an 8.2 out of 10, indicating a "great" episode, saying that it was not "quite as strong as the premiere, especially when some forced moments of humor fell flat", but praising the end sequence and the actions of Fitz and Johnson within it, the character beats for May, and the introduction of Clark as Strucker. Goldman also highlighted the guest casting Hong, and the return of MacNicol to the series. Joseph McCabe at Nerdist praised Tancharoen's direction, calling him "one of the show's strongest directors" and feeling that his episodes on the series are "remarkable not only for how well they move, but also for the clarity of their storytelling". Oliver Sava, writing for The A.V. Club, graded the episode a "B", calling it "an improvement on the season opener, proving that the best way to build a captivating story is by focusing on the characters and their relationships." Sava praised May's story arc, and Tancharoen's direction—while this episode doesn't give him very many chances to flex his action muscles, it still greatly benefits from his dynamic camerawork....Tancharoen understands the value of movement, giving his episodes a cinematic feel that compensates for TV's budgetary restrictions—but was disappointed that Simmons was brought back so soon after being revealed to be on an alien planet.

Rob Leane praised the episode, in his review for Den of Geek, for its focus on characters, relationships, and dialogue, noting how the series has moved away from more traditional, syndication-friendly standalone episodes, and instead relies more on the Netflix-style serialization. He stated that the episode did well "building up to a dramatic rescue sequence with an array of action-free dialogue scenes. Some may call this boring, but I thought it was a brave decision executed well. I wouldn't mind a few more like this." ScreenCrush's Kevin Fitzpatrick found "Purpose in the Machine" to have "surprising momentum for the third year's second hour, not only confirming to the team within minutes that Simmons was indeed alive on the other side of the monolith, but even rescuing her by the hour's end. Movement like that might easily have been stretched over the course of a half-season". Though he felt that the Ward and Hydra subplot should be removed from the series at this point, Fitzpatrick was positive about the May storyline, and praised the performances of De Caestecker and Henstridge. Scott Meslow of Vulture gave a less favorable review, scoring the episode 2 out of 5 stars, saying "maybe it sounds like I'm nitpicking at this point, and the last thing I want to do is ding a fun comic-book adaptation for doing fun comic-book stuff. But stories like the ones in "Purpose in the Machine" stand out because Agents of S.H.I.E.L.D. would be more fun, not less, if it were willing to tackle them in all their complexity." Meslow called out the decisions made by Coulson in particular, and named the episode's climax "a moment of totally unearned triumph, with bad decision after bad decision resulting in nothing but good news for everyone involved."