added support for OpenGM models