Fixed a major bug in the Theta calculation, overall still buggy