replaces foldl max with maximum & makes more efficient.