all c implementation