Added tests for marginal method of factor