switched from c++ to python