refactored marginalprobb