change laplace method to class
add test code for Laplace class