Updated function

Code updated to make cachematrix.R functional.