ex23.py updated