Add version for C++ code written using STL. It only runs 5 times faster than the R version...