Improved find_max.m