finished sorting and dicts and files