initial commit with topological sort