Organize queue using paths instead of priorities