Updated logic

Updated cachematrix.R