Wrote the InitializeTheta function.