fixed duality bug and added some code for returning bounded status (not yet used)
merging with unstable