starting C implementation