I thanked her for everything she had done.
When I got to the office, I realized that I had forgotten to lock the front door.
When they had finished their work, they went home.
When I had listened to the news. I went to bed.
I called you at 8.00, but you had just gone out.
Good luck!