sort by priority