almost done with problem 1