beginning C implementation