added kmax and k_per_logint