Build my own method in cachematrix.R