Implement cachematrix.R - Programming Assignment 2