started exercise 3 for hw2.