Added a length property to test the topological sorting