added comparison code, no demand curve case seems to be off
added comparison code, no demand curve case seems to be off