Edited cachematrix.R as per assignment2