Past continuous vs. past simple
Sentences you can recognize by the word 'when':
''When the phone rang, she was writing a letter.''
'' What were you doing when the earthquake started?''
If "while" is in a sentence you use the past contiuous twice:
''What were you doing while you were waiting?''
''I was studying while my father was making dinner.''