hw4 final code and plots