made more robust to malformed lines