I have updated the type-checking to use array2d.