Added a sorting functionality to handler and fixed the depth sorting system. Next I will need to modify the remaining handler classes.