successful solution for hw3.2
successful solution for hw3.1