added code for analytically marginalizing over the sky, untested