All tests are passing in R and c++