changed exception handling
added multidimensional array