math.min is enough, scala is automatically imported