Better parsing, write to CSV