Fixed up some calculations