just C code stuff