removing min/max functions to reuse valueBounds instead