fix sintax for multidimensional matrix definition and check that the item is of the right type
add test case for type checking and for get items
remove duplication