HW02 Exercises 2 through 5