rewrite in c using my C_NXT library started.