python seems to be too slow; do we need c++