Brazil is pioneering a new sort of jailhouse workout, in which inmates ride bikes instead of pumping iron. That’s not because they’d prefer fast inmates to strong ones (either one seems problematic if there’s an incident). It’s because the bikes, unlike weightlifting or prison-yard basketball, help power a nearby town.

The program has four bikes, sourced from the police department’s lost and found. The incentive, as the Associated Press reports, is that the more time inmates spend generating pedal power, the shorter their stay in prison will be:

Reader support makes our work possible. Donate today to keep our site free. All donations TRIPLED!

By pedaling, the inmates charge a battery that powers 10 street lamps along a riverside promenade. For every three eight-hour days they spend on the bikes, Silva and the program’s other volunteers get one day shaved off their sentences.

The inmates don’t charge the lights directly; the energy they generate goes into car batteries that a guard drives each night downtown. (Let’s hope it’s on his route home anyway, so he’s not expending extra energy to deliver the bike-powered electricity.)

The lights on the riverside promenade also improve the city’s walkability. Before the program started, the promenade was dark and abandoned at night. Now, according to the AP, city residents are jogging, biking, and strolling by the river at night. Which could mean less crime in the long run … except crap, then where would the energy come from?