finished matrix writeup