added progress bar, separate thread for running alg