updated and moved calc_cores