minor update: add '\n' for stderr.write()
              remove import of module re