changing minor bug in conversion from python to C++