preterm contractions but not in preterm labor

H
So yesterday I began having painless contractions back to back and had to go into labor and delivery to get checked out. They ran some tests and everything looked fine and the preterm labor test came back negative. They gave me a pill to try to stop my contractions and that didn't work, then they gave me a shot and that did stop my contractions and I was sent home. Has anybody ever gone through this? I am 27 weeks pregnant and want to make sure he keeps baking as long as possible!