change the computation of k