Implement updateMin, updateMax and equivalent withKey functions.