Added part 5 and 6 to hw2b.py