cachematrix.R modified by Kalyan on 27Apr2014