In which sentence does the underlined gerund function as the object of a preposition?

A-In their free time, the children enjoyed drawing.
B-The child was dizzy from twirling.
C-Singing was a favorite pastime.
D-The teacher encouraged reading.