adding support for multiple priority levels in the sweeper code