improved data dumping script