an ordering that understands dependencies

- this is a sketch ordering to see if it works
  better.