C basic implementation