added plot residuals