Using Math.max instead a implemented method to compute max value.