Added progress bar function.