Problems with C code