<P> During the meeting Michael calls Pam Beesly (Jenna Fischer) to read from one of the joke books in his desk, where she finds a screenplay written by Michael entitled Threat Level: Midnight, starring himself as "Agent Michael Scarn". The staff perform a read - through of the script, in which the character sequence "Dwigt" appears . They realize Michael based his incompetent sidekick on Dwight Schrute (Rainn Wilson), but later changed the name with a search and replace, which did not affect the single misspelling of Dwight's name . Dwight is upset and shuts down the exercise to invite everyone to set off fireworks outside, but only Kevin Malone (Brian Baumgartner) follows . </P> <P> When the staff discuss their worst first dates, Pam astounds them with a story of how her date forgot about her and left her behind at a high school hockey game . Their astonishment increases when they realize the date was her now - fiance Roy . Later, Jim Halpert (John Krasinski) and Pam break off their respective evening plans to enjoy an impromptu dinner on the roof and watch Dwight and Kevin fool around with fireworks . The next day Jim half - jokingly remarks to Pam that this was their first date . Pam responds in an unexpectedly harsh manner and a dismayed Jim makes an unwise crack at Pam about the hockey game date she earlier mentioned . Hurt, Pam breaks off the conversation . </P> <P> That morning, Dwight, having spent the night in the office, sees Jan coming by to retrieve her car, igniting gossip that she had sex with Michael . Michael reveals to the documentary crew that they made out and talked long into the night before falling asleep . Jan calls and says she regrets what happened, even accusing Michael of deliberately getting her drunk to initiate a romantic encounter with her, but Michael refuses to accept her change of heart . </P> <P> This episode was the third episode of the series directed by Greg Daniels . Daniels had previously directed the episodes "Basketball" and "The Dundies". "The Client" was written by Paul Lieberstein, who acts on the show as human resources director Toby Flenderson . The idea for Jan and Michael to have a romantic relationship was conceived by Steve Carell as far back as the filming of the pilot episode . According to writer and producer Greg Daniels "it was like he (Michael) was turned on by his teacher ." Writer and actor Paul Lieberstein said that the first idea that anybody came up for the episode was the final shot, where Jim and Michael look at each other and shake their heads, suggesting that they had been through similar experiences . The rest of the episode was written to lead to that scene . The scene where Oscar tells a story about a date getting a background check on him was based on an actual date that Paul Lieberstein went on . </P>

What episode of the office does micheal come back