Added test for maintaining link order for top sort