A more elegant way to implement a two-dimensional arrays is to create a new class, as suggested in Segmentmissing reference.