Added a progress bar function and example.