changed BASH scripts to use new code