Choose the correct answer:

Before I went to bed, I ________________my homework.
When I ____________ home, my sister had already finished cleaning.

The police __________ the thief because she had stolen the money.

Salma had visited China before she __________ to Qatar.

By the time I was 16 years old, I _________________ how to cook.

By the time the climbers _____________ the top of the mountain, it had started raining.

He left the cafe. I arrived. (by)

She finished her work. Then, she watched a movie. (after)