Zero is falsey so the `previous != 0` is a bit misleading.