Added strtok and strcmp for filtering undef fields