fixed a bug that the index will surpass the bound when dividing two folds due to the rounding of the ratio. but the workaround is not perfect, will improve that in the future.
add outputs for cumulative lower and upper bounds.