Adding topological ordering between shapes