entered functions into cachematrix.R