Almost 350 miles away from the Scottish Parliament in Edinburgh lies Brecon.

It's an unassuming, easy-going part of the UK that wouldn't register a second thought for many in Scotland.

So why has this market town in the Welsh countryside become important?

Well overnight, the small matter of a by-election result there could have pushed the UK closer to a general election.

The victory of the Liberal Democrats in the Brecon and Radnorshire constituency - and the rejection of sitting Tory MP Chris Davis, who had to face the by-election following guilty pleas to expenses fraud - now means that Boris Johnson will return to parliament after summer recess on September 3 with a working majority of one.

The new Prime Minister now has an even bigger mathematical challenge in the House of Commons than Theresa May did when her Brexit deal was rejected three times.

Boris Johnson has spent his first week in office touring the UK, building on his newly self-appointed title of Minister for the Union and repeating that while a no-deal Brexit isn't his preference, it remains a realistic prospect.

But he hasn't had much love back from his "love-bombing" of the nations. He had difficult conversations with Ruth Davidson, Nicola Sturgeon, Welsh First Minister Mark Drakeford, Irish Prime Minister Leo Varadkar and the leaders of the DUP and Sinn Fein.

Not exactly giving much hope for a united approach to these crucial 90 days until the UK's scheduled departure from the EU on October 31.

So looking to the next few weeks...

The Prime Minister now has a majority of just one. He doesn't have the support of the leaders of the devolved nations and Ireland (and they have no problem in being public about their divisions with him). And there doesn't seem to be much movement coming from the EU.

For him, something has to change.

Now there could be the thought that a defeat in Brecon could cause a rethink to any potential snap election. But that is one seat. And right now, Boris Johnson doesn't have much else to lose.

Boris Johnson returns to the Commons with not much wiggle room in the parliamentary arithmetic. He doesn't have a new deal from the EU. He is basically in the same position as Theresa May.

But he's also not as cautious at Theresa May. Or as concerned with persuading people from across the House to support his version of Brexit. He has the overwhelming support of the Tory Party members and the majority of their MPs.

He could and probably would return with a majority in an October election. He has much more support than Theresa May ever did from within the party. He would also attract back Conservative voters who sided with the Brexit Party at the European elections. He wouldn't get them all back - but enough to earn a majority.

That solves the numbers problem.

By having it in early October, it also means there is then the month of October for the EU to see he now has a majority to get 'no-deal' through if he has to, putting the ball in their court for any last-minute agreements.

Crucially, there is a European Council meeting on October 17 and 18 - two weeks before Brexit. This will be the first Boris Johnson will attend as Prime Minister. What could bolster his position more at that meeting with Merkel, Macron, etc, than entering the room knowing he has a strong majority back at Westminster? Again, pressure on the EU.

Finally, it buys him five years in power. Currently, the next UK general election is scheduled for May 5, 2022. If Mr Johnson was to wait until then, and if he were to lose that election, his premiership would be one of the shortest in recent history. Theresa May would have been in office longer than him. And that's a record he doesn't want.

So an election before Brexit sorts the Prime Minister's numbers problems, puts the pressure back on the EU and buys himself time.

And we return to Wales. While the Liberal Democrats may be celebrating, it's worth taking a moment to remember that this loss may not be causing the panic you'd expect in Number 10.

Buckle in, there could be a busy few months ahead.