function update (from HPC source)