finished probrem 4