updated C code samples