add static to max function