use first row and col as buffer to store zero-set-flag