Made some changes to improve speed.
Added test for extreme weights in laplace and fixed bug.