Update the scripts and add stored functions