adding some max() checks to avoid divide-by-zero on progress bad