reorganized to contain both c++ and python versions.