fixing topic sort