add C implementation sketch