fix makov blanket, support higher-order models.