some work on adding IOU function