continue to implement KL algorithm