You might wanna return something other than 0 when max value is exceeded to differentiate a normal return from an abnormal one.