Write a python program to find the maximum value in the given list of numbers.
[-2, 6, 8, -10]
def find_max(nums):
    max_val = nums[0]
    for num in nums[1:]:
        if num > max_val:
            max_val = num
    return max_val