ALM-625 make offset and rows local variables