done first pass of cacheSolve function + some testing in R.
seems to work.