optimize searching msa