Write a function to find the maximum number in a list.
Implement find_max(nums), which accepts a non-empty list of integers and returns its largest value. Do not use Python's built-in max() function. The function should work with positive, negative, and duplicate values.
def find_max(nums):