Thank you so much Santhosh. It works very well. I also tried to use it on my chart that appear on the top left as you suggested by putting the # on the declare lower and the input histogram and plot diff and it seems to work perfectly. Thank you once again for your time and effort.