added plotting functionality