cachematrix.R project assignment - R Programming