added topic sorting
topic sorting sentinel