added histogram plots to rstan function
fix histogram code