Updated cacheMatrix.R with my code

As per instructions I have updated the contents of the script with my code.