code and plots for assignment 1