added plot functionality -- not tested