Preterm labor.?

I passed what i think was my mucus plug today. And i have been having contractions for the past three days but they aren't constant. I think I've counted 12 the whole day today. What do you guys think I should do? I'm so worried cause I'm only 31w 2d