Calculating Q_{i}