Using an 2d array worked, but found another better solution.