exercise #3, both parts