trying to get marginalization to work... so many bugs!