Revised homework2-nmhw.ipynb