Basic functions implementation in C