completes p23.py, pretty straight forward