Changing total variation and weights computation to match new standards