added logic for makeCacheMatrix and cacheSolve functions