add hist.R for historical code
settle all issues with package loading