added code to plot variable distributions