Wrote the functions in cachematrix.R