Move ssh function below the sourcing bit