partial calculate function