fixed the calculation of the angle theta