Changed calc_theta. Copy files before calculating