add error checking, quiet option, output formatting