I found the following example in Manhattan GMAT flash cards. I cannot figure out the structure of the sentence especially the reason why "Thinking" is not incorrect. I though it should be "to think". Here is the sentence:
I sent a card thanking my eighth-grade English teacher for teaching me about grammar and inspiring me to write.
I sent a card thanking my eighth-grade English teacher for teaching me about grammar and inspiring me to write.
















