Finally have matrices working