base of compute function