BUFFALO, N.Y. (AP) — A former Buffalo, N.Y., parking meter mechanic has been sentenced to 2 1/2 years in prison for stealing thousands of dollars in quarters while on the job.

Prosecutors say it was James Bagarozzo's idea to rig meters to get at the coins. He stole $210,000 over more than eight years, grabbing fistfuls of coins, storing them in a bag in his truck and then rolling and cashing them in at banks.

Bagarozzo apologized during a brief statement. He blamed a gambling addiction and an illness he believed would kill him.

Bagarozzo pleaded guilty to theft in September, along with a former co-worker, Lawrence Charles. Charles admitted stealing $15,000 in quarters over about five years. He's expected to get six months to a year in prison at his Aug. 29 sentencing.