switched to regex, added verbosity, fixed other comments by @stefano-maggiolo