Hi, I just got another idea witch consist to use a continuous array for lines and columns (that is the first element of the second line is at index 9).
This array contains always 2 possibilities: array with special value for flag or hash with 2 keys Another idea ? Thanks Gilles