adding plotting functionality