wip derived factors, this compiles but still need to correctly compute index of derived factor
wip derived factors, this compiles but still need to correctly compute index of derived factor

anniecherk/pyschocnf,anniecherk/pyschocnf