Creation of max function.