implements sort, display, error handling and logging
delete unnecessary files