added library call
added test for is.matrix
updated funs
added BEGIN_RCPP and END_RCPP to handle errors correctly