rewrote prog7 to be really simple and slow, but actually work