added the math to calculate the weight for each set

Need to figure out how to get weights working when there are multiple
sets,