helper class used for KL methods and Laplacian method