initialising rows_spanned var before first loop