refactoring of hitrun.R hopefully done

not checked yet