Updated problem2.py to use generators
Added problem 3