Bobby Cleveland, an Oklahoma state representative, had some questions about the amount of money being spent at Joseph Harp Correctional Center. As chairman of the state House’s Public Safety Committee, state prisons fall under his jurisdiction. But on a tour of the prison facility, he and two fellow representatives found something they didn’t expect: a software program written by two inmates that could save the prison, and maybe the state, a lot of money.

The program tracks inmates as they proceed through food lines, to make sure they don’t go through the lines twice, Cleveland said in an interview. It can help the prison track how popular a particular meal is, so purchasers know how much food to buy in the future. And it can track tools an inmate checks out to perform their jobs.

“It’s a pretty neat program. It’s all done by the direction of the supervisor, one of these guys who’s kind of, what do you call it, thinking outside the box,” Cleveland said.

Cleveland said the program, if implemented statewide, could save Oklahoma up to $20 million a year.

It can also track incoming shipments of food and supplies — and catch discrepancies, like the one that raised red flags with Cleveland and his colleagues, state Reps. Scott Martin (R) and Jason Murphey (R). The software showed that Sysco, which supplies food to the state prison system, was charging the state different prices for the same food item sent to two different facilities, according to the Daily Oklahoman, which first reported the program  Monday.

The program came to lawmakers’ attention when Cleveland took a tour of the facility without the prison warden around. He brought his colleagues to a subsequent visit to hear about the program.

“It does kind of expose the waste at all the other facilities. It was just one of those genuine, lightning-strikes things,” Murphey said.

“When you deal with the way state government spends money, billions of dollars go through” the system, Murphey said. “You’re always dependent upon those at the ground level to report what’s going on. Here in this facility, you had those employees at the ground level taking their jobs very seriously.”

The supervisor, William Weldon, worked with two technologically-savvy inmates to develop the program. Prisoners each have a bar code they can scan, which then shows prison officials who has eaten a meal, or checked out a spatula before a shift in the kitchen, or borrowed a pair of gloves to scrub dishes after a meal. Jerry Massie, a spokesman for the Oklahoma Department of Corrections, said prison officials at Joseph Harp have used the software for about two years.

The software could even help save the state from lawsuits. Cleveland said several prisoners have sued over being denied special meals, whether for medical or religious reasons. When an inmate’s bar code is scanned, prison officials would be alerted that they should receive a diabetic meal, or a Halal or Kosher meal.

Massie said it was premature to think the program can make the leap from one prison to the rest of the state penitentiary system. But, he added, the program is working for Joseph Harp.

One caution flag, Murphey said, is that any software created by inmates to track something as valuable as food would need constant monitoring.

“If they build on what they’ve done here, they actually have to script it out. If you have inmates writing code, there has to be a continual auditing process,” he said. “Food in prison is a commodity. It’s currency.”

The Department of Corrections wouldn’t identify the inmates who created the program, beyond saying that one of them is a sex offender and one is serving a  sentence for murder. They may not be the most savory characters, but the program appears to be working.

“They built a system that could save the state millions of dollars,” Cleveland said. “I want to get the state using this thing.”