updates to functions as variable handling