Trees and Hills: Methodology for Maximizing Functions