Add thetae calculation: the functions are based on STPK