Added topological sorting to techmap