Redid tests and added a matrix generator.
Added a couple more comments.