First shot at ordering analysis. Not yet perfect, but somewhat useful...