By the time he _____, he had read all the books in the library. A. finished B. finish C. will finish D. had finished