cleaned up problem 3