order entities by depth