simplifying a bit, making wrap-around more predictable