Move initialization of highest_matched and highest_matched_index