Write find_local_max method