Making more robust. max row number and max char cont