run-cmd implementation complete