Updated C code