completed assignment for cachematrix.R