successfully solves problem 4
cleaning up problem 4