Replaced custom "capNumber" function with the standard constrain() macro.