updated and finished python example