moved histogram code to its own stage resolve input/output issue. removed inline R code and replaced with simple R script