simplify overflow checks somewhat