Added comments for the c code