working binary inference