Updates to cachematrix.R to complete assignment2