wrapped up problem 3!