Added a progress bar for the inner loop