refactoring / complete tests under way, found a bug in hitandrun R code