loop instead of accumulating and printing at the end; changed yaml.load() to safe_load(). Fixed echo via subshell.