The ongoing debate over whether Massachusetts needs new natural gas pipelines, and who will pay for them, went before the Commonwealth's highest court this week -- and now the state's energy future is largely in the hand of justices on the Supreme Judicial Court. 

The issue is a confusing tangle of federal and state laws that can be tough to wrap your mind around. To oversimplify a bit: justices are deciding whether the state can allow electric utilities to fund natural gas pipelines and pass the cost to customers. 

So... let's start with why we're even talking about this now. The answer: companies like Spectra want to build new natural gas pipelines into the region to -- they say -- relieve high energy costs in the state. 

What do those companies have to do in order to build those pipelines? The Federal Energy Regulatory Commission makes the companies show they have people to buy the gas the new pipelines would bring to the state. 

Lucky for them, there are companies lining up to buy fuel from those proposed pipelines. They are electric utilities National Grid and Eversource. And the Baker administration wants to give those contracts its blessing. The state Department of Public Utilities says it also has the authority to approve a plan whereby electric utilities would pass the cost on to customers with an additional line on bills. Ratepayers would essentially be paying for the construction of new pipelines. 

But here's the rub, according to the state Attorney General's Office and the Conservation Law Foundation: electric utilities can't buy gas in Massachusetts. That's the argument their attorneys made to justices Thursday. They point to a law legislators passed 20 years ago in response to high electricity costs. The law restructured the industry, requiring electric utilities to sell their generating plants. Energy generation was supposed to be separated from energy distribution. To the AG and CLF, that means electric utilities can't buy natural gas. 

Lawyers for Eversource, National Grid, and the Department of Public Utilities, though, told the Supreme Judicial Court the DPU isn’t specifically prohibited from approving an arrangement where electric companies contract for pipeline space. Further, they said, the DPU is authorized to do what it judges is in the best interest of customers. 

Now it's up to justices to decide, ultimately, whether pipeline companies will be able to gather the money and get the approval they need to build new infrastructure in the state.