Updated computation function