c implementation of some components