Compute() function