cachematrix.R edited as per assignment