sample code from my graphical models course.