Improved functionality of calcBinBinHist and calcBinBinHist.R