added extra calculation for first trigger