for (i = 0; i < symbol/2; i ++) { current_pair = *(freq_ptr++); total_pair_weight = both_weights[current_pair]; prev_cum += total_pair_weight; }