variable renaming, added sort as a method to filter by depth for non yui resources too