Added threading and progress bars