the codes from learning C