I HAD JUST FINISHED THE JOB WHEN THE FACTORY CLOSED.

7. I had just finished the job when the factory closed.