added progress bar
reconfigured progressbar code for better configuration