fix calculation of dd.remaining and remove where ratios/diffs calculated