cachematrix.R complete for assignment 2