running k in a parfor loop