added lprintf for progress bar