Adding the remaining code and plots