added MAX and MIN