added inheritance to fitting algs, still to polish