update the functions