tweaked to use as_string in example