Optimizing the aperiodic merit factor of binary arrays