Added working version of cacahematrix.R