stuff for Coursera class Discrete Optimization