implementing plot