updated TODO; do we want to rewrite code in C++/Fortran or mex to speed things up?