Fixed formula for theta.