Programming assignment 2 (cacheMatrix) for R programming course