Mass killings have become a political football. Liberals claim that it is mostly a gun problem and that mental illness plays an insignificant role. Conservatives, including President Donald Trump, argue that it is primarily a mental illness problem and that guns don’t kill people, people kill people. As most thoughtful people long ago concluded, it is of course, both.

Exhibit A is Seth Ator, a 36-year-old man who on Aug. 31 killed seven and injured 22 in Odessa before being killed in a shootout with police. Thanks to his psychiatric records obtained by CNN, we know that Ator had a 18-year history of severe mental illness, violent behavior and failure to take the medication needed to control his illness. At age 18 he attempted suicide, was hospitalized, and became so violent that nurses had to lock themselves in a room. At age 23 he was again involuntarily hospitalized as being a danger to himself or others.

In 2011 at age 28 he was hospitalized again after threatening to kill his family with a machete found hidden in his bed. Believing that there was a government conspiracy against him, at that time he had also dug an underground shelter in his backyard for a “planned stand-off with police,” according to the police report. “The officers were so troubled by what they encountered that they recorded floor plans of the property and shared the information with the city’s SWAT team.” Ator told his family: “911 will bow down before me.” At some point after this he tried to buy a gun but failed the background check, presumably because of his involuntary psychiatric hospitalizations.

Given this history, I think that almost everyone except the most rabid civil libertarians and Second Amendment enthusiasts would agree that Ator should have received ongoing psychiatric treatment and should not have had access to guns. But we failed on both counts. Regarding the first, his 2011 hospitalization took place in Amarillo at the Pavilion, a psychiatric facility that is part of the for-profit Universal Health Services Inc. Potentially violent psychotic patients like Ator are often not welcome at for-profit psychiatric hospitals; they are disruptive, require extra staffing, and frighten the other patients and staff. In 2011 the Pavilion discharged Ator after only a few days, despite evidence of his need for treatment.

Ator should have been sent to a state hospital and stabilized on medication, but in Texas, as in all other states, most state hospital beds have been closed. Once stabilized, he should have been put on assisted outpatient treatment, meaning that he would have to take medication as a condition for living in the community. Recently Sen. John Cornyn and other Republican senators introduced the Response Act to help prevent mass shootings, including making assisted outpatient treatment more widely available.

The system for keeping guns out of the hands of people like Ator is also broken. Background checks to regulate commercial gun sales are often effective, as they were in this case. However, such checks do not apply to private gun sales which, according to news reports, was how Ator obtained his gun. Private sales should require approval from the police certifying that the buyer is not on the no-sale list. Note that fixing either the mental illness treatment system or the gun access system would have prevented the mass killing in this case. Common sense suggests that both should be fixed.

Fixing these systems will not stop all mass killings, but it will be a start. Studies suggest that at least one-third of such killings are carried out by individuals with serious mental illness who are not being treated. At least one-third of these were known by mental health professionals or police to be dangerous prior to the killings. If we can prevent even 10% of these tragedies, we will be making a useful start on this problem.

Dr. E. Fuller Torrey is the founder of the Treatment Advocacy Center in Arlington, Va.

John Snook is executive director of the center. They wrote this column for The Dallas Morning News.