used DataFrame instead of Series; wrote to file