Utility class to go from a nested array tree # to a grid