changes suggested by @svargo and @schisamore