add example, fix error in topological sort