Added write to CSV, doesn't loop