use long instead of size_t, to avoid cast and make underflow result
negative