sort files and categories