added primalLaplace and dualLaplace functions