make start agent a helper function