update cachematrix.R with completed solution