cleaned up and check in final cachematrix.R