moving code into Python/SDK