finished applying shellcheck suggestions