changed to use `matrix' package and remvoed Algebra.Linear