The Past Progressive is used:
time in the past.
"What were you doing at 10 o'clock last night?"
"I was taking a shower."
time in the past (usually with while or as)
"While John was cooking, Lynn was sleeping"
"My grandphater was writing a play in those days"