calculateConsumption improved