Are you certain that (length rel_lst) = (length descrepancy) ?
Perhaps using (while (and rel_lst descrepancy) ... ) would be safer.
rel_lst and descrepancy are 2 different lists
Exactly - the test expression for your while loop is only testing whether one of these lists is non-nil, yet both are reduced within the while loop, meaning one list could be nil before the other unless (length rel_lst) = (length descrepancy) as noted.
i didnt think of that, youre absolutely right that might be the case, i will look into that.