this is a instantiation of the pagination function, we cannot put it in the auto-loader since the variable($threads) can be changed po.