trying to lower memory usage of import script, and failing