the episode was written by james wong and directed by alfonso gomez rejon