 As with other series storylines, this development was decided upon before Kaling began writing the episode.She stated, "But it was always sort of built in that the peak of 'Diwali' would be this incredibly romantic overture [and its uncomfortable aftermath].