the cases don't quite match up, for example if A is a child of B, A will be considered after B, but we want A to be before B (as its before the end of B)