IF football were a more quantifiable science, it would be a lot easier to work out exactly what causes a team to play well or to play poorly.

If we bothered with the sort of statistical analysis that has become integral in sports such as baseball or American football then we could say with some certainty that, for example, if right winger X comes up against left-back Y then his chances of beating him and getting to the bye-line are Z%.

When St Mirren began the season without a win in their opening seven matches the public response to the rather obvious question about what was going wrong was a serious of shrugs and a promise to work harder. Perhaps behind the scenes manager Danny Lennon knew why things were not clicking but it seemed no matter what tweaks he made the result was always the same.

Then, inadvertently, he got a break. Danny Grainger's red card at Easter Road and an injury sustained by Marc McAusland forced Lennon into shuffling his defence for the match against Aberdeen last Monday. In came Lee Mair, who had been left on the sidelines after electing not to leave the club in the summer, Darren McGregor, who had been used sparingly after his return from a second cruciate injury in two years, and Sean Kelly, a 20-year-old left- back who spent last season on loan at East Stirlingshire in the Irn-Bru Third Division. To accommodate that influx, captain Jim Goodwin was returned to midfield, a position where Lennon had previously felt he picked up too many yellow cards, while talented teenager John McGinn also came back into the side.

Somehow it all came together. After coming within six minutes of victory against Aberdeen, Lennon stuck with the same starting line-up against Hearts and was rewarded with another bright performance that delivered his team's first two away goals, a first clean sheet and, most importantly, a first win of the season. McGregor and Mair already look a solid partnership, while Kelly has made a rapid assimilation to top-flight football. St Mirren, though, defended well as a unit at Tynecastle, with even striker Steven Thompson popping up in his own box to boot crosses clear and generally stifle the Hearts attack.

Thompson turns 35 next week but there is no sign of the player slowing down. Operating effectively as a lone striker, he rarely gave the home defence a minute's peace on Saturday and, although he was not directly involved in the two goals St Mirren scored, his tireless running created spaces for midfielders such as McGinn, Paul McGowan and Conor Newton to exploit.

Almost seven years after his brother Stephen had scored a winning goal at the same ground, McGinn headed St Mirren into the lead late in the first half, and McGowan added a second midway through the second. Hearts rallied but St Mirren held on comfortably for the win to take them 12 points clear of their vanquished opponents.

"We had the belief in ourselves that we could turn it around," Kelly explained. "We just had to stay compact in a game and keep a clean sheet. We knew we were conceding far too many easy goals. We can possibly start to look upwards. The three points take us further away from Hearts but it only takes a set of results after the international break to be back where we were before. We have to try to build a bit of momentum."

For Kelly it has been a pivotal week - his status changing from fringe player to first-team defender - but he admitted to "tuning out" before matches to stay focused. "I don't let anyone speak to me about it beforehand, including my mates who might try to hype it up. It was difficult to keep away from things because people are talking about it on Facebook, Twitter and all the rest. Obviously you see it but you can't take it to heart and allow it to build pressure on you before the game. A couple of my mates are St Mirren fans so it's a bit surreal. You dream about playing at places like this when you are younger. This has only been two games, but I have been delighted with the opportunity."

Hearts had pinpointed this game as a real chance for them to take a giant leap towards safety, their dejection almost tangible come the end. A goalkeeping blunder at the second goal and some missed chances, from Callum Paterson, ended up proving costly. "The pressure maybe got to a few boys, but we can't let our heads go down," said winger Jamie Walker. "Hopefully we can claw back a few more points in the coming weeks."