reorder tasks by priority