Coursera ProgrammingAssignment2 cacheMatrix