1. We had just heard the news when you rang.
2. I had already thought of that before you suggested it.
3. When I turned on the TV, the programme had already started.
4. She was hungry because she hadn't eaten anything all day.
5. By the time I left school I had decided to become a musician.