added filter for plotting