Added max' function