You use the variable name `ind_diffs_which_changed` multiple times, but I think it should be `ind_which_changed` ...