the episode was written by jon vitti and directed by lance kramer