updated to split lines on ; and fields on # (and handle malformed lines)