Added Tolerance and Threshold for MaxX function calls