trying to calculate formula