sort files into categories