Do we need an erlang:max(0, ...) here to avoid a negative result?