cachematrix.R updated per assignment2 requirements