Better depth sorting.