Added partially completed code for the autoCalcute().

Warning extremely complicated