Updated so matrix takes object instead of strings. Updated test.