Added compute function