funtion for plots and decisions