Should this be diff[c] =  ... 
or does diff[c] get reset appropriately across iterations?