I began thinking madly.
I began using my brain wildly.