almost finished hw2 pt 4