cleanup and update c++ and python examples