started working on depth sorting