Corrected calculation of S to take into account when qeff is bigger than 1/2