sort depth and add name