redid/simplified LIV and ECO in functions.r:

problem with pre_index functions and subgoal...