changing appropriate variables to use local instead of assign