Added some tests and renamed 'array' variable to 'matrix'