Update CalculateDeltaQ function