added code for plots