Update functions.f90