Code for Linear Algebra in Java without use of outside libraries