This logic seems to me like it is always going to skip rows at indices e.g if totalObjects is 50, it is going to skip rows at indices 5, 11, 17 etc.