added plot at end