fixing calculation errors with denominator

@zmyao88 I made some corrections to the gapsheet script. Can you please check over and then merge?