upgrade following to use sets+priority