单项选择题

The secretary worked late into the night, ______ a long speech for the president. ( )

A.to prepare
B.preparing
C.prepared
D.was preparing