huaj2008 revised cachematrix.R