Second attempt at problem2.py