Reorganized Matrix.java