fix example.py and make it toggle output bit 40