We calculate the maximum value two times. See the the cdef block.