minor revision of C sample code