removed unnecessary code from util and calculation