added plot functionality