added some C utils