Add a function to a python program that returns the maximum value in a list of integers.
arr = [3, 6, 4, 7, 15, 10]
def max_val(arr):
    max_val = 0
    for num in arr:
        if num > max_val:
            max_val = num
    return max_val