Updating Python code