Update function calculate