单项选择题

When I arrival, the lecture had already started and the professor ______ something on the blackboard.

A. wrote
B. had been writing
C. is writing
D. was writing