Tested the matrix, added javadoc comments