Update HW2.py

- some changes in plotting
- save plot
-optimize some parts of code