took calc_jphi out of m loop. Took other calc_jphi out of else statement again.