use assert for error checking
use proper strcmp idiom