Fixed a bug in the c program