Added input check to cacheSolve. Added comments.