There were a lot of scowls in the House gallery Monday from supporters of Utah’s medical marijuana initiative, many of whom had committed countless hours over several years and were elated on election night when Proposition 2 passed — only to have it seemingly jerked away when the state Legislature quickly passed a replacement bill.

The anger and frustration are understandable. It was a bait-and-switch, the same old story of legislators and power brokers ignoring the will of the people. And there was justifiable angst, given lawmakers’ long-standing resistance to any medical marijuana program.

But let’s take a step back and look at how far we’ve come.

As recently as nine months ago — and for years prior — serious medical marijuana legislation wasn’t even being considered on Capitol Hill. Now, Utah has joined 31 other states where medical marijuana is legal.

That is tremendous progress in what probably seemed like an eternity to suffering patients and their loved ones, but is lightning speed in legislative terms — and that is solely because of the voters.

Francisco Kjolseth | The Salt Lake Tribune The Salt Lake Tribune staff portraits. Robert Gehrke.

The decision by some Prop 2 proponents to come to the table and negotiate created a huge rift in the pro-medical marijuana community. It appears it was the right decision. For one thing, the Legislature was going to rewrite Prop 2 with help from the LDS Church and Utah Medical Association whether or not medical marijuana advocates participated.

Had Prop 2 passed without a compromise in place, it would have been bogged down in litigation (lawsuits were already filed). Maybe it would have held up in court, maybe not. But it would have resulted in enormous costs and possible delays in getting cannabis to patients.

More fundamentally, it seems clear in hindsight that Proposition 2 would have failed had a compromise not been in place. One pollster I talked to told me that after the church’s official pronouncement against Prop 2, support plummeted literally overnight, especially among Latter-day Saints. Clearly, a concerted effort with a couple million more dollars behind it would have doomed the proposition, and there would have been nothing left to force opponents to the negotiating table.

There are several clear improvements made in the new law, passed Monday. Under the initiative, someone caught with cannabis can assert an “affirmative defense” in court that they are using it medicinally, but that only extended until cannabis cards are issued in March 2020. The new law fills in a gap, allowing the defense up until cannabis is actually available in January 2021.

The bill also prevents a gun owner from being denied a firearm because he or she uses medical cannabis, it clearly protects caretakers of “vulnerable adults” from losing custody on the basis of medical cannabis use (which Proposition 2 did not), and it prevents the government from discriminating against a medical cannabis user.

While Proposition 2 was not perfect, neither is the new law.

The bill strips out language protecting renters with medical cannabis cards from being discriminated against by landlords. If the aim of the bill is to treat cannabis as medicine, then people should not have to fear losing their housing because of the medicine their doctor prescribes.

Along those same lines, if cannabis is medicine, then adults who can be prescribed opioids, for example, should also be able to receive medical marijuana. But that’s not the way the new law works for those who are adults under age 21. They have to petition the Compassionate Use Board for a special dispensation. Rep. Brian Greene proposed an amendment to fix that flaw, but it was voted down.

The replacement bill took out language that would have let patients have loose marijuana bud or flower. Law enforcement wanted the change, since officers wouldn’t be able to tell if a patient got the cannabis legally or illegally. In its place, marijuana flower will have to be individually blister packaged and bar-oded or the product has to be sold in a processed form and pre-packaged in blister packs, which is good in terms of measured dosing.

But it can cause problems. Doug Rice, one of the leading proponents of Proposition 2, told me that his daughter, Ashley, used to suffer from as many as two dozen seizures a day because of her epilepsy, but the THC in marijuana almost entirely stopped them.

However, the THC level in processed products gets patients high, he explained, whereas raw cannabis does not. He could put the raw plant in a breakfast smoothie, he said, and she could get the same effect without getting stoned, but the blister-packaging makes it impractical because he can’t judge quality. He compares it to buying individually packaged grapes and says it needs to be changed.

There are other areas that may need to be re-evaluated, including one huge one: Can the state deliver medical cannabis to patients?

Utah will be the first state to try the new hybrid model of distribution. Orders would be filled at a central pharmacy, then sent to county health departments, where patients can pick them up. The advantage, if it works, is that rural Utahns who might not have a private dispensary nearby — thanks to Prop 2’s onerous financial requirements imposed to get a license to run a private dispensary — may have more access.

As a backstop, the state will license private dispensaries that will not go through the central pharmacy, creating redundancy. The seven authorized in the legislation will likely be mostly in urban areas.

So we’ll have to see if the state can make the centralized pharmacy model a reality. And, if it does work, will it be an efficient, patient-friendly operation or will it be the equivalent of state liquor stores for medicine?

The bill passed this week makes some improvements on the list of patients who qualify for medical cannabis. Under Prop 2, patients with chronic pain could only qualify if they were at risk of becoming dependent on opiates — almost setting opiates as a default. Now, those with pain lasting more than two weeks are eligible, with opiates out of the equation.

Eligibility for patients who are terminally ill — part of the “right to try if you die” legislation passed last session — has been restored. And it clears up any question that CBD oil is still available for epilepsy patients.

The list left off several autoimmune diseases, like lupus and rheumatoid arthritis. Rice said that was an arbitrary decision and those diseases cause inflammation that can be helped by cannabis. Connor Boyack from the Libertas Institute, one of the architects of both Prop 2 and the negotiated bill, said the Utah Medical Association wanted a much shorter list, and they had to fight for the conditions that survived.

Utah’s medical marijuana program is going to be a work in progress. It has been in every state that has tried it.