R Programming Coursera - Assignment 2 cachematrix