functions from clio.go moved to run.go