Fixed some errors in how the values were calculated.