Added getFunction() and getSum()
Fixed output not being set by update stuff