Fixed find_max.m, need to work on boundary cases