hw2 problem b done