add my solution to exercise 3