if we worry about performance, we could bail out before the loop if `diff != 0`