Modified run_external_command to return result
added unit tests