probably fixed off-by-one turns

I had overcomplicated it before. Thanks to mueslo for pointing it out.