refactored marginal probb