matrix class finished. squashing bugs