Added code and plots for tasks 1 and 2