seriel verision of the find max function