Try to improve the C code and the comments