Implemented sorting and progress dialog.