Implemented BackgroundWorker and ProgressBar for a more responsive UI.