Another minor change. Put progress bar update to the timer thread because the calculation thread loops too quickly and interferes with the visual effect of the progress bar.