hitrun.R rewritten

Still needs testing.  Does not pass old tests.