directory now writes to csv