Update for depth sorting