Which sentence contains a gerund?
A. I laughed when my best friend fell asleep during the long movie.
B. Esmeralda surprises her friends by throwing surprise parties.
C. The dog sitting under the tree barked at everyone who passed by.
D. In order to get a good grade, Lucas is studying for his math test.