added option to print the progress