added shellcheck and fixed all the things